Exemplo n.º 1
0
        public void AccountService_Register_CanRegister_Success()
        {
            // Arrange
            IMember        existedMember = null;
            UserToRegister user          = GetUserToRegister();

            _memberService.GetByEmail(user.Email).Returns(existedMember);

            // Act
            Result registrationResult = _accountService.Register(user);

            // Assert
            Assert.IsNotNull(registrationResult, Common.ShowResponseTypeMismatchMessage(typeof(Result)));
            Assert.IsTrue(registrationResult.IsSuccess, Common.ShowNotSatisfiedExpectationMessage(true, "registrationResult.IsSuccess"));
            _userRegistration.Received(1).Register(Arg.Is(RegistrationPredicate(user)));
        }