public void UnableToLoadThrowsError() { MockDiskImage image = new MockDiskImage(); image.LoadReturnValue = false; Ultima1Data data = new Ultima1Data(image); data.Load("blah"); }
public void SaveFailsToWriteAllBytes() { MockDiskImage image = new MockDiskImage(); image.Files["P0"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); image.Files["P0"].MaxBytesToWrite = 400; Ultima1Data data = new Ultima1Data(image); data.Load("blah"); data.Save(); }
public void PartialDiskLoad() { MockDiskImage image = new MockDiskImage(); image.Files["P0"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); image.Files["P2"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); image.Files["P3"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); Ultima1Data data = new Ultima1Data(image); data.Load("blah"); Assert.AreEqual(3, data.NumberOfCharacters); Assert.AreEqual("Wolfgang", data.Characters[0].Name); Assert.AreEqual("Wolfgang", data.Characters[1].Name); Assert.AreEqual("Wolfgang", data.Characters[2].Name); }
public void Save() { MockDiskImage image = new MockDiskImage(); image.Files["P0"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); image.Files["P2"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); image.Files["P3"] = new MockImageFile(System.IO.File.ReadAllBytes("data\\p3.prg")); Ultima1Data data = new Ultima1Data(image); data.Load("blah"); data.Characters[0].HitPoints = 1234; data.Characters[1].HitPoints = 2345; data.Characters[2].HitPoints = 3456; data.Save(); data.Dispose(); // Coverage }
public void UnableToLoadThrowsErrorForReal() { Ultima1Data data = new Ultima1Data(); data.Load("blah"); }