Exemplo n.º 1
0
        public async Task ProjectService_ChangeActivationForProject_Success()
        {
            // arrange
            var request = GetProjectChangeActivationRequest();

            MockUserRepository.Setup_SelectById_Returns_OrganizationOneAdminUserOne();
            MockProjectRepository.Setup_Select_Returns_OrganizationOneProjectOne();
            MockProjectRepository.Setup_Update_Success();
            MockOrganizationRepository.Setup_Any_Returns_False();

            // act
            var result = await SystemUnderTest.ChangeActivationForProject(request);

            // assert
            result.Status.ShouldBe(ResponseStatus.Success);
            result.ErrorMessages.ShouldNotBeNull();
            result.ErrorMessages.Count.ShouldBe(0);
            AssertReturnType <ProjectChangeActivationResponse>(result);
            MockUserRepository.Verify_SelectById();
            MockProjectRepository.Verify_Select();
            MockProjectRepository.Verify_Update();
            MockOrganizationRepository.Verify_Any();
        }