Пример #1
0
        public void ReturnIsSuccessfulEqualsFalse()
        {
            // Arrange
            mocker.GetMock <IUserService>()
            .Setup(u => u.SignIn(It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync((PlannerAppUser)null);
            sut = mocker.Create <SignInUserCommand>();
            // Act
            var result = sut.Execute(mocker.Create <SignInUserModel>()).Result;

            // Assert
            Assert.False(result.IsSuccessful);
            Assert.NotNull(result.Error);
        }
Пример #2
0
 public SignInUserCommandShould()
 {
     fixture = TestFixture.Create();
     mocker  = new AutoMoqer();
     user    = new PlannerAppUser
     {
         Email    = EMAIL,
         TenantID = TENANTID
     };
     mocker.SetInstance <IConfiguration>(new ConfigurationMock());
     mocker.GetMock <IUserService>()
     .Setup(u => u.SignIn(It.IsAny <string>(), It.IsAny <string>()))
     .ReturnsAsync(user);
     sut = mocker.Create <SignInUserCommand>();
 }