public void FilterOnInvalidEntityTypeJournal() { var result = new DeletedEntitiesProxy().GetDeletedEntities(entityType: "aaaa"); Assert.False(result.IsSuccessfull, "Filter on invalid entity type should not have succeded"); Assert.Null(result.DataObject); }
public void FilterOnEntityTypePurchase() { var result = new DeletedEntitiesProxy().GetDeletedEntities(entityType: "Purchase"); Assert.True(result.DataObject != null, "Error with response object"); Assert.True(result.DataObject.Entities != null, "Error with response object entity collection"); Assert.Null(result.DataObject.Entities.SingleOrDefault(e => e.EntityType != "Purchase")); }
public void FilterOnEntityTypePurchase() { var result = new DeletedEntitiesProxy().GetDeletedEntities(entityType: "Purchase"); Assert.NotNull(result.DataObject, "Error with response object"); Assert.NotNull(result.DataObject.Entities, "Error with response object entity collection"); Assert.IsNull(result.DataObject.Entities.SingleOrDefault(e => e.EntityType != "Purchase"), "Non-purchase entity type in result set"); }
public void GetAllNoFilters() { var result = new DeletedEntitiesProxy().GetDeletedEntities(); Assert.True(result.DataObject != null, "Error with response object"); Assert.True(result.DataObject.Entities != null, "Error with response object entity collection"); Assert.Null(result.DataObject.Entities.SingleOrDefault(e => _allNotDeleted.Contains(e.EntityId))); }
public void GetAllNoFilters() { var result = new DeletedEntitiesProxy().GetDeletedEntities(); Assert.NotNull(result.DataObject, "Error with response object"); Assert.NotNull(result.DataObject.Entities, "Error with response object entity collection"); Assert.IsNull(result.DataObject.Entities.SingleOrDefault(e => _allNotDeleted.Contains(e.EntityId)), "Not deleted transactions contained in result set"); }
public void FilterOnUtcDeletedDateTime() { var fromDate = DateTime.UtcNow.AddHours(-1); var toDate = DateTime.UtcNow; var result = new DeletedEntitiesProxy().GetDeletedEntities(utcDeletedFromDate: fromDate, utcDeletedToDate: toDate); Assert.True(result.DataObject != null, "Error with response object"); Assert.True(result.DataObject.Entities != null, "Error with response object entity collection"); Assert.Null(result.DataObject.Entities.SingleOrDefault(e => e.Timestamp <fromDate || e.Timestamp> toDate)); }
public void FilterOnUtcDeletedDateTime() { var fromDate = DateTime.UtcNow.AddHours(-1); var toDate = DateTime.UtcNow; var result = new DeletedEntitiesProxy().GetDeletedEntities(utcDeletedFromDate: fromDate, utcDeletedToDate: toDate); Assert.NotNull(result.DataObject, "Error with response object"); Assert.NotNull(result.DataObject.Entities, "Error with response object entity collection"); Assert.IsNull(result.DataObject.Entities.SingleOrDefault(e => e.Timestamp <fromDate || e.Timestamp> toDate), "Entity outside of specified deleted times was returned"); }
public void TestPaging() { var proxy = new DeletedEntitiesProxy(); var result = proxy.GetDeletedEntities(pageNumber: 1, pageSize: 3); Assert.True(result.DataObject != null, "Error with response object"); Assert.True(result.DataObject.Entities != null, "Error with response object entity collection"); Assert.True(result.DataObject.Entities.Count == 3); var idsFromResult = new List <int> { result.DataObject.Entities[0].EntityId, result.DataObject.Entities[1].EntityId, result.DataObject.Entities[2].EntityId }; result = proxy.GetDeletedEntities(pageNumber: 2, pageSize: 3); Assert.True(result.DataObject != null, "Error with response object, second request"); Assert.True(result.DataObject.Entities != null, "Error with response object entity collection, second request"); result.DataObject.Entities.ForEach(e => Assert.False(idsFromResult.Contains(e.EntityId), "Entity from first page also contained in second")); }