public void Add_NullItemThrowArgumentNullException_Test() { // Act var target = new ListRepository(); Entity entity = null; // Act target.Add(entity); }
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)); }