public void ApplyChanges_Test() { // Act var target = new ListRepository(); Entity item = target.GetAll().First(); // Assert target.Modify(item); }
public void DeleteTest() { // Act var target = new ListRepository(); // Act IEnumerable <Entity> result = target.GetAll(); Entity firstEntity = result.First(); target.Remove(firstEntity); IEnumerable <Entity> postResult = target.GetAll(); // Assert Assert.IsNotNull(postResult); Assert.IsFalse(postResult.Contains(firstEntity)); }
public void GetAllTest() { // Act var target = new ListRepository(); // Act IEnumerable <Entity> result = target.GetAll(); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count() == 1); }
public void AddTest() { // Act var target = new ListRepository(); var entity = new Entity { Id = 4, SampleProperty = "Sample 4" }; // Act target.Add(entity); IEnumerable <Entity> result = target.GetAll(); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count() == 2); Assert.IsTrue(result.Contains(entity)); }