示例#1
0
        public void SerializeDirtyExbin()
        {
            NintendoLand.DataFormats.FruitData fruitData = NintendoLand.DataFormats.FruitData.Load(pathToYsiExtract);
            fruitData.UpdateFruit(new NintendoLand.DataFormats.FruitData.Fruit(10, NintendoLand.DataFormats.FruitData.FruitType.Bananas, NintendoLand.DataFormats.FruitData.FruitType.Strawberry));
            List <byte> serializedData = new List <byte>();

            fruitData.SerializeExbin(ref serializedData, 16 + 84 * 90 + 3); // magic number is the max length of the default FruitData.exbin-file (16 [header] + 84 [one fruit definition] * 90 + 3 [footer])

            CollectionAssert.AreNotEqual(
                File.ReadAllBytes(Path.Combine(pathToYsiExtract, "FruitData.exbin")),
                serializedData
                );
        }
示例#2
0
 public void InsertUpdateFruitReturnValue()
 {
     NintendoLand.DataFormats.FruitData fruitData = NintendoLand.DataFormats.FruitData.Load(pathToYsiExtract);
     Assert.IsTrue(fruitData.UpdateFruit(new NintendoLand.DataFormats.FruitData.Fruit(10, NintendoLand.DataFormats.FruitData.FruitType.Bananas, NintendoLand.DataFormats.FruitData.FruitType.Strawberry)));
     Assert.IsFalse(fruitData.UpdateFruit(new NintendoLand.DataFormats.FruitData.Fruit(200, NintendoLand.DataFormats.FruitData.FruitType.Bananas, NintendoLand.DataFormats.FruitData.FruitType.Strawberry)));
 }