public void GetFiltered_SpecificKOrder_DescendingOrder_Test() { // Act var target = new ListRepository(); // Act target.GetFiltered(e => e.Id == 1, t => t.Id, false); }
public void Attach_NullItem_Test() { // Act var target = new ListRepository(); // Act target.Attach(null); }
public void GetFiltered_SpecificKOrder_DescendingOrderAndFilterNullThrowArgumentNullException_Test() { // Act var target = new ListRepository(); // Act target.GetFiltered(null, t => t.Id, false); }
public void ApplyChanges_NullEntityThrowNewArgumentNullException_Test() { // Act var target = new ListRepository(); // Assert target.Modify(null); }
public void GetFiltered_FilterNullThrowArgumentNullException_Test() { // Act var target = new ListRepository(); // Act target.GetFiltered(null); }
public void ApplyChanges_Test() { // Act var target = new ListRepository(); Entity item = target.GetAll().First(); // Assert target.Modify(item); }
public void Add_NullItemThrowArgumentNullException_Test() { // Act var target = new ListRepository(); Entity entity = null; // Act target.Add(entity); }
public void Delete_NullItem_Test() { // Act var target = new ListRepository(); Entity entity = null; // Act target.Remove(entity); }
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 GetFilteredTest() { // Act var target = new ListRepository(); // Act IEnumerable <Entity> result = target.GetFiltered(e => e.Id == 1); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Count() == 1); Assert.IsTrue(result.First().Id == 1); }
public void GetPaged_DescendingOrder_Test() { // Act var target = new ListRepository(); int pageIndex = 0; int pageCount = 1; // Act PagedElements <Entity> result = target.GetPaged(pageIndex, pageCount, e => true, e => e.Id, false); // Assert Assert.IsNotNull(result); Assert.AreEqual(1, result.TotalElements); }
public void GetFilteredAndOrderedAndPagedElements_InvalidPageIndexThrowArgumentException_Test() { // Act var target = new ListRepository(); int pageIndex = -1; int pageCount = 1; // Act PagedElements <Entity> result = target.GetPaged( pageIndex, pageCount, e => e.Id == 1, null, false); }
public void Attach_Test() { // Act var target = new ListRepository(); var entity = new Entity { Id = 5, SampleProperty = "Sample 5" }; // Act target.Attach(entity); // Assert Assert.IsTrue(target.GetFiltered(t => t.Id == 5).Count() == 1); }
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 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)); }
public void GetFiltered_WithDescendingOrderedAndPagedElements_Test() { // Act var target = new ListRepository(); int pageIndex = 0; int pageCount = 1; // Act PagedElements <Entity> result = target.GetPaged( pageIndex, pageCount, e => e.Id == 1, e => e.Id, false); // Assert Assert.IsTrue(result != null); Assert.IsTrue(result.TotalElements == 1); }
/// <summary> /// A test for Container /// </summary> public void unitOfWorkTestHelper <T>() where T : class { // Act var target = new ListRepository(); }