public async Task Create_Duplicate_Manufacturer_Should_Throw_Exception() { //Arrange ManufacturerInput manufacturer = new ManufacturerInput { ManufacturerName = "Canon" }; //Assert await Assert.ThrowsAsync<UserFriendlyException>(() => _manufacturerAppService.CreateManufacturerAsync(manufacturer)); }
public async Task Create_Manufacturer_Should_Success() { //Arrange ManufacturerInput manufacturer = new ManufacturerInput { ManufacturerName = "aaa" }; //Act await _manufacturerAppService.CreateManufacturerAsync(manufacturer); }
public async Task<ActionResult> Create(ManufacturerInput manufacturer) { if (ModelState.IsValid) { await _manufacturerAppService.CreateManufacturerAsync(manufacturer); return RedirectToAction("Index"); } return View(manufacturer); }
//Create manufacturer based on input public async Task CreateManufacturerAsync(ManufacturerInput input) { await _manufacturerDomainService.CreateAsync(input.MapTo<Manufacturer>()); Logger.Info("Manufacturers: Created a new device category: " + input.ManufacturerName); }