public void AddAndOverrideTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var resultOfAdd = facts.Add(today.DayOfYear.ToString(), today.ToString()); var oldValue = facts.Read(today.DayOfYear.ToString()); var resultOfOverride = facts.Add(today.DayOfYear.ToString(), today.ToLongDateString()); var laterValue = facts.Read(today.DayOfYear.ToString()); // Assert Assert.True(resultOfAdd); Assert.True(resultOfOverride); Assert.NotEqual(oldValue, laterValue); }
public void AddWrongTest(string key, string value) { // Align var facts = new FactsBase(); // Act var resultOfAdd = facts.Add(key, value); // Assert Assert.False(resultOfAdd); }
public void AddConfirmationTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var resultOfAdd = facts.Add(today.DayOfYear.ToString(), today.ToString()); // Assert Assert.True(resultOfAdd); }
public void ExistsWrongTest(string key, string value) { // Align var facts = new FactsBase(); // Act var resultOfAdd = facts.Add("test_key_1", "test_value_1"); var actual = facts.Exists(key, value); // Assert Assert.True(resultOfAdd); Assert.False(actual); }
public void ReadValueTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var resultOfAdd = facts.Add(today.DayOfYear.ToString(), today.ToString()); var actual = facts.Read(today.DayOfYear.ToString()); // Assert Assert.True(resultOfAdd); Assert.Equal(today.ToString(), actual); }
public void AddCountTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var countBefore = facts.Count(); var resultOfAdd = facts.Add(today.DayOfYear.ToString(), today.ToString()); var countAfter = facts.Count(); // Assert Assert.True(countBefore < countAfter); }
public void AddKeepsCasesTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; const string coolCaps = "SuperDuperYellowDuckyBot"; // Act var resultOfAdd = facts.Add(today.DayOfYear.ToString(), coolCaps); var resultOfRead = facts.Read(today.DayOfYear.ToString()); // Assert Assert.True(resultOfAdd); Assert.Equal(coolCaps, resultOfRead); }
public void AddReadAndRemoveTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act and Assert var resultOfAdd = facts.Add(today.DayOfWeek.ToString(), today.ToString()); var resultOfRead = facts.Read(today.DayOfWeek.ToString()); var resultOfRemove = facts.Remove(today.DayOfWeek.ToString()); // Assert Assert.True(resultOfAdd); Assert.NotNull(resultOfRead); Assert.True(resultOfRemove); }
public void RemoveConfirmationTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var resultOfAdd = facts.Add(today.DayOfYear.ToString(), today.ToString()); var countBefore = facts.Count(); var resultOfRemoval = facts.Remove(today.DayOfYear.ToString()); var countAfter = facts.Count(); // Assert Assert.True(resultOfAdd); Assert.True(countBefore > countAfter); Assert.True(resultOfRemoval); }
public void CountsTest() { // Align var facts = new FactsBase(); var today = DateTime.Today; // Act var countBeforeAdd = facts.Count(); var resultOfAdd = facts.Add(today.DayOfWeek.ToString(), today.ToString()); var countAfterAdd = facts.Count(); var resultOfRead = facts.Read(today.DayOfWeek.ToString()); var countAfterRead = facts.Count(); var resultOfRemoval = facts.Remove(today.DayOfWeek.ToString()); var countAfterRemoval = facts.Count(); // Assert Assert.True(resultOfAdd); Assert.NotNull(resultOfRead); Assert.True(resultOfRemoval); Assert.NotEqual(countBeforeAdd, countAfterAdd); Assert.NotEqual(countAfterRead, countAfterRemoval); Assert.Equal(countBeforeAdd, countAfterRemoval); Assert.Equal(countAfterAdd, countAfterRead); }