public async Task <IActionResult> AddSingleItem(License model) { var license = await logic.AddDataModelAsync(model); await logProvider.AddToLogAsync($"Added new license (Id: {license.Id})."); return(RedirectToRoute(LicensesRouting.Index)); }
public async void AddLicense_ToEmptyDbTable_AddedLicenseEqualExpectedLicense() { // arrange var expected = GetLicense(); // act await logic.AddDataModelAsync(expected); // assert var actual = await fixture.db.License.FirstOrDefaultAsync(i => i.Id == expected.Id); Assert.Equal(expected.Id, actual.Id); Assert.Equal(expected.ProductId, actual.ProductId); Assert.Equal(expected.Date, actual.Date); Assert.Equal(expected.GovermentNum, actual.GovermentNum); }
public async Task <IActionResult> AddSingleItem(License model) { var statusMessage = await logicValidation.CheckAddDataModelAsync(model); if (statusMessage.IsCompleted) { var license = await logic.AddDataModelAsync(model); await logProvider.AddToLogAsync($"Added new license (Id: {license.Id})."); return(RedirectToRoute(LicensesRouting.Index)); } else { return(View("CustomError", statusMessage)); } }