コード例 #1
0
        public async Task When_Add_Employee_Async_Then_Add_Employee_To_Context()
        {
            // Arrange
            var employee = fixture.Build <Employee>().Without(x => x.Positions).Without(x => x.ManagerEmployee).Create();

            // Act
            await sut.AddEmployeeAsync(employee);

            // Assert
            var result = context.Employees.Local.FirstOrDefault(x => x.Id == employee.Id);

            result.Should().NotBeNull();
            result.Should().Be(employee);
        }