public void Create_Should_Check_Access_To_Referred_BranchOffice() { // Given var newPos = new Position { Name = "Electrical Engineer", BranchOfficeId = _branch.Id }; // When _serviceUnderTest.AddAsync(newPos).Wait(); // Then _branchOfficeRepo.Received().GetAsync(newPos.BranchOfficeId.Value); _repository.Received().Add(newPos); _repository.Received().SaveChangesAsync(); }
public async Task ShouldAddPosition() { // Arrage var service = new PositionService(_mockUow.Object, _mapper, _mockRepo.Object); // Act var b = new Position { Name = "Position", }; await service.AddAsync(b); // Assert _mockUow.Verify(m => m.SaveAsync(), Times.Once()); }