public void WriteTest() => File.OpenRead(@"kh2/res/enmp.bin").Using(stream => { Helpers.AssertStream(stream, inStream => { var outStream = new MemoryStream(); Enmp.Write(outStream, Enmp.Read(inStream)); return(outStream); }); });
public void ReadTest() => File.OpenRead(@"kh2/res/enmp.bin").Using(stream => { var table = Enmp.Read(stream); Assert.Equal(229, table.Count); var roxas = table.FirstOrDefault(enemy => enemy.Id == 242); Assert.Equal(99, roxas.Level); Assert.Equal(1750, roxas.Health[0]); Assert.Equal(86, roxas.MaxDamage); // 56 Assert.Equal(28, roxas.MinDamage); Assert.Equal(100, roxas.PhysicalWeakness); Assert.Equal(25, roxas.FireWeakness); Assert.Equal(25, roxas.IceWeakness); Assert.Equal(25, roxas.ThunderWeakness); Assert.Equal(25, roxas.DarkWeakness); Assert.Equal(25, roxas.LightWeakness); Assert.Equal(100, roxas.GeneralWeakness); });