public void Read_With_EmptyKeyword_Return_Success() { string testName = GetCurrentMethod(); var dbContext = _dbContext(testName); IIdentityService identityService = new IdentityService { Username = "******" }; DOReturnItemLogic unitUnderTest = new DOReturnItemLogic(GetServiceProvider(testName).Object, identityService, dbContext); dbContext.DOReturnItems.Add(new DOReturnItemModel() { ProductName = "ProductName", Active = true, CreatedBy = "someone", ProductCode = "ProductCode", UId = "1", CreatedUtc = DateTime.UtcNow, LastModifiedBy = "someone", PackingUom = "", CreatedAgent = "CreatedAgent", DeletedAgent = "DeletedAgent", IsDeleted = false, LastModifiedUtc = DateTime.UtcNow, LastModifiedAgent = "LastModifiedAgent" }); var result = unitUnderTest.Read(1, 1, "{}", new List <string>() { "" }, null, "{}"); Assert.NotNull(result); }
public void Read_With_EmptyKeyword_Return_Success() { string testName = GetCurrentMethod(); var dbContext = _dbContext(testName); IIdentityService identityService = new IdentityService { Username = "******" }; DOReturnItemLogic unitUnderTest = new DOReturnItemLogic(GetServiceProvider(testName).Object, identityService, dbContext); dbContext.DOReturnItems.Add(new DOReturnItemModel() { ProductName = "ProductName", Active = true, CreatedBy = "someone", ProductCode = "ProductCode", ShipmentDocumentCode = "ShipmentDocumentCode", UId = "1", UomUnit = "UomUnit", UomId = 1, CreatedUtc = DateTime.UtcNow, LastModifiedBy = "someone", Total = 10000, Quantity = "", PackingUom = "", CreatedAgent = "CreatedAgent", DeletedAgent = "DeletedAgent", IsDeleted = false, LastModifiedUtc = DateTime.UtcNow, LastModifiedAgent = "LastModifiedAgent" });; dbContext.SaveChanges(); int page = 1; int size = 1; string order = "{}"; string keyword = null; //string filter = @"{""ProductName"":""""}"; var result = unitUnderTest.Read(page, size, order, new List <string>() { "" }, keyword, "{}"); Assert.NotEmpty(result.Data); }