Plaintiff E. L. Faulconer, Jr., served as an employee of defendant Wysong & Miles Company for approximately 30 years. On or about 26 October 1981, plaintiff and defendant entered into an Amended and Restated Agreement (Agreement). This Agreement provided for plaintiff to receive supplemental retirement and death benefits from defendant in recognition of his years of faithful service, loyalty to defendant (including a non-compete provision) and required physical check-ups.
Plaintiff retired from defendant’s employ in 1987. According to plaintiff, defendant was obligated to him in the sum of $2,620.80 per month under the Agreement. It appears that all payments were made *599up until the fall of 2000. At that point, defendant suspended its payments to plaintiff.
Plaintiff filed a complaint on 2 July 2001. According to plaintiff, as of the date of the complaint, defendant had missed 8 payments, and owed him the principal sum of $20,966.40 plus interest.
Defendant filed its answer on 10 September 2001. In its answer, defendant admitted that the two parties had entered into the aforementioned agreement. Defendant further admitted that it had failed to make the 8 payments, stating that “due to existing impracticability, Wysong has failed to make some payments to Mr. Faulconer.” The focus of this appeal are the affirmative defenses included in defendant’s answer. They are as follows:
FIRST AFFIRMATIVE DEFENSE
Due to the precipitous decline in the metal-working machine manufacturing industry, for which Wysong is not in any way responsible, and the non-occurrence of which event was a basic assumption on which the Agreement was made, it is impracticable for Wysong to continue making payments to Mr. Faulconer and therefore, Wysong is discharged from any such responsibility.
SECOND AFFIRMATIVE DEFENSE
Wysong repeats and realleges all of the allegations contained in the Complaint and the First Affirmative Defense as if restated herein. In addition, payments to Mr. Faulconer by Wysong, due to the precipitous decline in the metal-working machine manufacturing industry, could be made only at an excessive and unreasonable cost to Wysong.
THIRD AFFIRMATIVE DEFENSE
Wysong repeats and realleges all of the allegations contained in the Complaint and the First and Second Affirmative Defenses as if restated herein. When the parties entered into the Agreement, both parties contemplated the continued economic prosperity of the metal-working machine manufacturing industry, and did not contemplate in any way such a precipitous decline as has occurred.
Plaintiff filed a motion to strike defendant’s affirmative defenses on 15 October 2001 based on the failure of defendant to set forth facts sufficient to constitute a defense. The motion stated that “[t]he claim *600that any decline in the metal-working machine manufacturing industry, or any commercial impracticability, discharges Defendant from its obligations under the [agreement] or in any way provide [s] a defense to Plaintiffs Complaint is not supported by applicable law.”
Defendant submitted the affidavit of Thomas R. Adkisson, who was the Chief Operating Officer for defendant at the time. According to him, defendant hit hard times in the spring of 2000. Further, while other companies in the same business went bankrupt, defendant continued to pay its bills, even though it had to lay off some workers. As to the payments to plaintiff, defendant chose to suspend payments because a review of the Board minutes surrounding the execution of the agreements like plaintiffs led him to believe that these agreements depended on defendant’s business continuing to prosper, and that it was not the intent behind those agreements to have to lay off employees in order to pay plaintiff and others like him.
A hearing was held on plaintiffs motion to strike on 10 December 2001. On 12 December 2001, the Honorable William Z. Wood, Jr., ruled for plaintiff and held that “[d]efendant’s affirmative defenses are insufficient in that they fail to set forth facts sufficient to constitute a defense to the claim sued upon in this cause.” Defendant appeals.
Defendant presents the following question on appeal: Did the trial court err in granting plaintiffs motion to strike defendant’s affirmative defenses?
 Initially, we note that defendant’s appeal is properly before us.
Ordinarily, Rule 4(b) of the Rules of [Appellate Procedure] precludes an appeal “from an order striking or denying a motion to strike allegations contained in pleadings.” However, when a motion to strike an entire further answer or defense is granted, an immediate appeal is available since such motion is in substance a demurrer.
 Defendant contends that it was error for the trial court to grant plaintiff’s motion to strike his affirmative defenses, which attempt to assert the doctrine of commercial frustration, pursuant to Rule 12(f) of the N.C. Rules of Civil Procedure.
*601Under Rule 12(f), the trial court “may order stricken from any pleading any insufficient defense or any redundant, irrelevant, immatérial, impertinent, or scandalous matter.” G.S. § 1A-1, Rule 12(1). A motion under Rule 12(f) is a device to test the legal sufficiency of an affirmative defense. See Trust Co. v. Akelaitis, 25 N.C. App. 522, 525, 214 S.E.2d 281, 284 (1975). “If there is any question as to whether an issue may arise, the motion [under Rule 12(f)] should be denied.” Shellhorn v. Brad Ragan, Inc., 38 N.C. App. 310, 316, 248 S.E.2d 103, 108 [disc. review denied, 295 N.C. 735, 249 S.E.2d 804 (1978)].
The doctrine of frustration of purpose is discussed in 17 Am. Jur. 2d Contracts § 401 (1964) as follows:
“Changed conditions supervening during the term of a contract sometimes operate as a defense excusing further performance on the ground that there was an implied condition in the contract that such a subsequent development should excuse performance or be a defense, and this kind of defense has prevailed in some instances even though the subsequent condition that developed was not one rendering performance impossible. ... In such instances, . . . the defense doctrine applied has been variously designated as that of ‘frustration’ of the purpose or object of the contract or ‘commercial frustration.’
[“] Although the doctrines of frustration and impossibility are akin, frustration is not a form of impossibility of performance. It more properly relates to the consideration for performance. Under it performance remains possible, but is excused whenever a fortuitous event supervenes to cause a failure of the consideration or a practically total destruction of the expected value of the performance. The doctrine of commercial frustration is based upon the fundamental premise of giving relief in a situation where the parties could not reasonably have protected themselves by the terms of the contract against contingencies which later arose.”
*602If the frustrating event was reasonably foreseeable, the doctrine of frustration is not a defense. In addition, if the parties have contracted in reference to the allocation of the risk involved in the frustrating event, they may not invoke the doctrine of frustration to escape their obligations. 17A C.J.S. Contracts § 463(2) (1963). See also Perry v. Champlain Oil Co., 101 N.H. 97, 134 A.2d 65 (1957); Blount-Midyette & Co. v. Aeroglide Corp., 254 N.C. 484, 119 S.E.2d 225 (1961); Annot., 84 A.L.R.2d 12 (1962).
Essentially, there must be an implied condition to the contract that a changed condition would excuse performance; this changed condition causes a failure of consideration or the expected value of performance; and that the changed condition was not reasonably foreseeable.
Defendant alleged in his affirmative defenses that there was a precipitous decline in its business, that it was an implied condition to the agreement that this decline not occur and the parties did not contemplate such a decline, and now it is impractical, excessive and unreasonable to continue to make payments to plaintiff.
We hold that the doctrine of frustration of purpose is inapplicable to the present case and that the trial court was correct in granting plaintiff’s motion to strike. First of all, there is a problem with implication by defendant that there were some sort of implied conditions to this contract. The admissibility of such evidence is questionable at best under the parol evidence rule, considering the Agreement states that “[t]his Amended and Restated Agreement amends and restates in its entirety the Agreement dated January 30, 1978 between the Employee and the Company, together with all amendments thereof. This Amended and Restated Agreement may not be amended or modified except by a writing signed by the Employee and the Company.” The Agreement mentions nothing about what would happen during a period of decline.
However, we do not address this issue (as the parties have not) as this defense is not viable, because it is reasonably foreseeable that a business may suffer a distinct period of decline. This is not a situation in which the parties could not reasonably have protected themselves. The affidavit of the Chief Operating Officer states that the company was nearly bankrupt in the early 1990s. The company had obviously experienced periods of decline before. It cannot now *603expect this Court to entertain the notion that it never expected to have them again. Further, there is no connection between the fortunes of the company and its obligation to plaintiff. The possibility that defendant may again experience hard times was foreseeable, and appears to have been expressly provided for in the agreement. The agreement states:
Unsecured Obligation. ... To the extent that [plaintiff] and his surviving spouse may be entitled to receive payment from [defendant] under this Amended and Restated Agreement, [plaintiff] and his surviving spouse shall have no rights against [defendant] other than those accorded to general, unsecured creditors of [defendant] under law.
It appears to this Court that this section contemplates bad times currently suffered by defendant, namely bankruptcy. It is implied that defendant would still owe on the contract even if it went bankrupt, and plaintiff would then be an unsecured creditor with a right to collect from defendant commensurate with other unsecured creditors like him. This provision allocates to plaintiff the risk that defendant may go bankrupt, and prevents the application of the doctrine of frustration.
Judges WALKER and TYSON concur.