public async Task GetAsync2_ReturnsRecordWithId2() { //Assert //Act var result = await testedService.GetAsync(2); //Assert Assert.Equal(testEntities.ToArray()[2], result); }
public async Task UnitService_Should_Get_Null_When_Unit_Not_Exist() { // Arrange SetUpUnitOfWork(); var service = new UnitService(_unitOfWork.Object, _mapper); // Act var entity = await service.GetAsync((new Random()).Next()); // Assert Assert.Null(entity); }
public async Task UnitService_Should_Delete_Unit_Async() { // Arrange SetUpUnitOfWork(); var service = new UnitService(_unitOfWork.Object, _mapper); var entity = new UnitDTO() { Name = "TestName", ShortName = "TestSN", }; entity = await service.CreateAsync(entity); await _unitOfWork.Object.SaveAsync(); // Act await service.DeleteAsync(entity.Id); await _unitOfWork.Object.SaveAsync(); // Assert Assert.Null(await service.GetAsync(entity.Id)); }