示例#1
0
        public async Task TestCheckSameWhiteListGroup()
        {
            var groupAppService = Substitute.For <IGroupAppService>();

            groupAppService.CheckSameWhiteListGroupAsync(User_EmployeeMdmId, Arg.Any <Guid>())
            .Returns(Task.FromResult(true));

            var target = new EmployeeController(
                CreateMemoryCache(),
                CreateMapper(),
                Substitute.For <IDepartmentAppService>(),
                Substitute.For <IPositionAppService>(),
                Substitute.For <IEmployeeAppService>(),
                groupAppService,
                _ => Substitute.For <IUserFavoriteAppService>(),
                _ => Substitute.For <IUserSettingAppService>());

            target.ControllerContext = CreateMockContext();

            var result = await target.CheckSameWhiteListGroup(Guid.NewGuid());

            result.Value.Should().BeTrue();
        }