
948 So.2d 841 (2007)
John DeMARTINO and Judy DeMartino, Appellants,
v.
Lisa SIMAT, as Personal Representative of the Estate of Gary Simat; Windsor Group; and Enterprise Leasing, Appellees.
No. 2D05-6189.
District Court of Appeal of Florida, Second District.
January 26, 2007.
*842 K. Jack Breiden of Breiden & Associates, Naples, for Appellants.
Michael A. Tonelli and John W. Boult of Barr, Murman & Tonelli, P.A., Tampa, for Appellee Enterprise Leasing.
Terrence L. Lavy of Vernis & Bowling of Southwest Florida, P.A., Fort Myers, for Appellee Windsor Group.
No appearance for Appellee Lisa Simat as Personal Representative of the Estate of Gary Simat.
NORTHCUTT, Judge.
John and Judy DeMartino are plaintiffs in a personal injury suit arising from an automobile accident. The DeMartinos sued the driver of the other vehicle, Gary Simat, and the owner of the vehicle, Enterprise Leasing. Prior to filing the lawsuit, Mrs. DeMartino had given a release to Simat's insurer, Windsor Group, in exchange for its $25,000 policy limits. On the basis of that release, Enterprise sought and obtained a partial summary judgment on Mrs. DeMartino's personal *843 injury claim against it. Thereafter, the DeMartinos were granted leave to amend their complaint to add a count against Windsor for reformation of the release. However, the circuit court then dismissed the reformation count with prejudice. The DeMartinos appeal both the partial summary judgment and the order dismissing the reformation count. As to the former order, we must dismiss the appeal for lack of jurisdiction. As to the latter order, we reverse.
The DeMartinos' complaint against Simat and Enterprise was in four counts. In count one, Mr. DeMartino sought damages for personal injury from Simat and Enterprise. In count two, Mrs. DeMartino sought damages for personal injury from Enterprise only. Count three was a loss of consortium claim by Mr. DeMartino against Enterprise only, and count four was a loss of consortium claim by Mrs. DeMartino against Simat and Enterprise. Enterprise filed a third-party claim against Simat seeking indemnification.
By affirmative defense, Simat and Enterprise maintained that Mrs. DeMartino's personal injury claim and Mr. DeMartino's loss of consortium claim were barred by the release Mrs. DeMartino had given to Windsor. Mrs. DeMartino argued that the release was only intended to apply to Simat and was never intended to settle her personal injury claim against Enterprise. On motion for partial summary judgment, the circuit court ruled that Mrs. DeMartino's personal injury claim against Enterprise, count two of the original complaint, was barred by the release.
We do not have jurisdiction to review this partial summary judgment because the claim it resolved and the counts that remain pending involve the same parties and arose from the same transaction. The counts are legally and factually related, such that the order resolving count two is not a final appealable order. See S.L.T. Warehouse Co. v. Webb, 304 So.2d 97 (Fla. 1974). Accordingly, we dismiss the appeal insofar as it pertains to the partial summary judgment on count two.
After the adverse summary judgment on count two, the DeMartinos were allowed to amend their complaint to allege a claim for reformation of the release based on mutual mistake, adding Windsor as a party for the first time. After the amendment, Enterprise moved to dismiss this claim (although Enterprise was not a party to the reformation count), and Windsor adopted Enterprise's motion. They asserted that the reformation count was barred under the law of the case established by the partial summary judgment on count two, and the circuit court agreed. Its order dismissing the reformation count is final for purposes of appeal because it totally disposed of the case as to Windsor, and we have jurisdiction to review it. See Fla. R.App. P. 9.110(k).
A motion to dismiss tests the legal sufficiency of a complaint to state a cause of action; it does not turn on issues of ultimate fact. Holland v. Anheuser Busch, Inc., 643 So.2d 621, 624 (Fla. 2d DCA 1994). Therefore, in ruling on a motion to dismiss, the court is confined to the four corners of the complaint and must take as true all well-pleaded, material facts. Temples v. Fla. Indus. Constr. Co., 310 So.2d 326 (Fla. 2d DCA 1975); Gennaro v. Leeper, 313 So.2d 70 (Fla. 2d DCA 1975). The court may not grant a motion to dismiss based on an affirmative defense that does not appear on the face of the complaint. Swinney v. City of Tampa, 707 So.2d 765 (Fla. 2d DCA 1998). The order dismissing the DeMartinos' reformation count was improper for those reasons.
Moreover, the law of the case doctrine simply was not applicable in this *844 case. That doctrine applies only to rulings on questions of law that were actually presented and considered in a prior appeal. Fla. Dep't of Transp. v. Juliano, 801 So.2d 101, 106 (Fla.2001); U.S. Concrete Pipe Co. v. Bould, 437 So.2d 1061, 1063 (Fla. 1983). Other than the dismissal of a previous attempt to appeal a nonfinal, nonappealable order, there have been no appellate court rulings on questions of law in this case.
Accordingly, we reverse the dismissal of the DeMartinos' claim for reformation, and we remand for further proceedings.
Dismissed in part; reversed in part; remanded.
SALCINES and VILLANTI, JJ., Concur.
