Beispiel #1
0
        private static void OnSave2(Action <SaveKhRecom> test)
        {
            const string FilePath = "Saves/BASLUS-21799COM-02";

            using (var stream = File.OpenRead(FilePath))
                test(SaveKhRecom.Read(stream));
        }
Beispiel #2
0
        private static void OnSave(Action <SaveKhRecom> test)
        {
            const string FilePath = "Saves/BISLPM-66676COM-01";

            using (var stream = File.OpenRead(FilePath))
                test(SaveKhRecom.Read(stream));
        }
Beispiel #3
0
        public void IsNotValidIfLengthIsNotEnoughTest()
        {
            var data = new byte[0xf];

            data[0] = 7;
            using (var stream = new MemoryStream(data))
                Assert.False(SaveKhRecom.IsValid(stream));
        }
Beispiel #4
0
        public void IsNotValidIfMagicCodeIsNotRecognizedTest()
        {
            var data = new byte[0x10];

            data[0] = 6;
            using (var stream = new MemoryStream(data))
                Assert.False(SaveKhRecom.IsValid(stream));
        }
Beispiel #5
0
        public void IsValidTest()
        {
            var data = new byte[0x10];

            data[0] = 7;
            using (var stream = new MemoryStream(data))
                Assert.True(SaveKhRecom.IsValid(stream));
        }
 public void OpenStream(Stream stream)
 {
     _save = SaveKhRecom.Read(stream);
     RefreshUi();
 }