public async void DriverUpdate() { // Arrange this.FleetDbContext.VehicleDrivers.AddRange( new VehicleDriverEntity() { VehicleDriverId = 1, DriverName = "Peter", CompanyId = 1, DeletedInd = false }, new VehicleDriverEntity() { VehicleDriverId = 2, DriverName = "Raju", CompanyId = 1, DeletedInd = false }); await this.SaveChangesAsync(this.FleetDbContext); VehicleDriverModel model = new VehicleDriverModel() { VehicleDriverId = 2, DriverName = "Jagan" }; // Act AjaxModel <NTModel> ajaxModel = await this.Controller.DriverUpdate(model); // Assert VehicleDriverEntity entity = this.FleetDbContext.VehicleDrivers.Where(e => e.VehicleDriverId == 2).First(); Assert.Equal(entity.DriverName, "Jagan"); Assert.Equal(ajaxModel.Message, FleetMessages.DriverSaveSuccess); }
public async void DriverAdd() { // Arrange VehicleDriverModel model = new VehicleDriverModel() { VehicleDriverId = 0, DriverName = "Jagan" }; // Act AjaxModel<NTModel> ajaxModel = await this.Controller.DriverAdd(model); // Assert VehicleDriverEntity entity = this.FleetDbContext.VehicleDrivers.Last(); Assert.Equal(entity.DriverName, "Jagan"); Assert.Equal(ajaxModel.Message, FleetMessages.DriverSaveSuccess); }
public async void DriverAdd() { // Arrange VehicleDriverModel model = new VehicleDriverModel() { VehicleDriverId = 0, DriverName = "Jagan" }; // Act AjaxModel <NTModel> ajaxModel = await this.Controller.DriverAdd(model); // Assert VehicleDriverEntity entity = this.FleetDbContext.VehicleDrivers.Last(); Assert.Equal(entity.DriverName, "Jagan"); Assert.Equal(ajaxModel.Message, FleetMessages.DriverSaveSuccess); }
public async void DriverUpdate() { // Arrange this.FleetDbContext.VehicleDrivers.AddRange( new VehicleDriverEntity() { VehicleDriverId = 1, DriverName = "Peter", CompanyId = 1, DeletedInd = false }, new VehicleDriverEntity() { VehicleDriverId = 2, DriverName = "Raju", CompanyId = 1, DeletedInd = false }); await this.SaveChangesAsync(this.FleetDbContext); VehicleDriverModel model = new VehicleDriverModel() { VehicleDriverId = 2, DriverName = "Jagan" }; // Act AjaxModel<NTModel> ajaxModel = await this.Controller.DriverUpdate(model); // Assert VehicleDriverEntity entity = this.FleetDbContext.VehicleDrivers.Where(e => e.VehicleDriverId == 2).First(); Assert.Equal(entity.DriverName, "Jagan"); Assert.Equal(ajaxModel.Message, FleetMessages.DriverSaveSuccess); }
public async Task DriverSave(VehicleDriverModel model) { await vehicleRepository.DriverSave(model); }
public async Task DriverSave(VehicleDriverModel model) { await SaveEntity <VehicleDriverEntity, VehicleDriverModel>(model); }
public async Task <AjaxModel <NTModel> > DriverUpdate([FromBody] VehicleDriverModel model) { return(await AjaxHelper.SaveAsync(m => domain.DriverSave(model), Messages.Fleet.DriverSaveSuccess)); }
public async Task DriverSave(VehicleDriverModel model) { await this.fleetRepository.DriverSave(model); }
public async Task <AjaxModel <NTModel> > DriverAdd([FromBody] VehicleDriverModel model) { return(await AjaxHelper.SaveAsync(m => this.domain.DriverSave(model), FleetMessages.DriverSaveSuccess)); }