public void ShouldOverWriteFile() { var test = new TestClasse { PropertyOne = "test", PropertyTwo = 1, }; using (var store = new SerializationStorage<TestClasse>()) { store.Add(test); store.Add(test); store.Add(test); store.Add(test); } var test2 = new TestClasse { PropertyOne = "test2", PropertyTwo = 2, }; using (var store = new SerializationStorage<TestClasse>()) { store.Clear(); store.Add(test2); } using (var store = new SerializationStorage<TestClasse>()) { Assert.IsTrue(store.Last().PropertyTwo == 2); } }
public void TestWriteTwice() { var test = new TestClasse { PropertyOne = "test", PropertyTwo = 1, }; using (var store = new SerializationStorage<TestClasse>()) { store.Add(test); } using (var store = new SerializationStorage<TestClasse>()) { Assert.IsTrue(store.Last().PropertyOne == "test"); store.Last().PropertyTwo = 2; } using (var store = new SerializationStorage<TestClasse>()) { Assert.IsTrue(store.Last().PropertyTwo == 2); } }