public async void UpdateAsync_InvalidParameters_ReturnsMinus4() { var repository = new Mock <IVehicleModelRepository>(); var classForTesting = new VehicleModelService(repository.Object); var result = await classForTesting.UpdateAsync(Guid.NewGuid(), Guid.Empty, "test", "test"); result.Should().Be(-4); }
public async Task Update_Succes() { var vehicleModel = new VehicleModel { Id = 5, MakeId = 3, Name = "306", Abrv = "306" }; modelRepository.Setup(x => x.UpdateAsync(It.IsAny <VehicleModel>())) .ReturnsAsync(1); var vehicleModelService = new VehicleModelService(modelRepository.Object); var result = await vehicleModelService.UpdateAsync(vehicleModel); result.ShouldBeEquivalentTo(1); }