public void GetValueReturnsDefaultTIfKeyDoesNotExist() { // Arrange var savegame = new Savegame("123/456".ToValidSavegameString()); const int invalidKey = 1000; // Act var result = savegame.GetValue<int>(invalidKey); // Assert result.Should().Be(default(int)); }
public void GetValueReturnsValueIfKeyDoesExist() { // Arrange var savegame = new Savegame("123/456".ToValidSavegameString()); const int validKey = 2; // Act var result = savegame.GetValue<int>(validKey); // Assert result.Should().Be(456); }
public void SetValueSfChangesValue() { // Arrange var savegame = new Savegame("123/456".ToValidSavegameString()); const SF validKey = (SF) 2; var oldValue = savegame.GetValue(validKey); // 456 // Act savegame.SetValue(validKey, 0); // Assert var newValue = savegame.GetValue(validKey); newValue.Should().NotBe(oldValue); }