Example #1
0
        public void ThrowsArgumentException_WhenPassword_IsEmptyString()
        {
            // Arrange
            var fakeOwinContext = new Mock <IOwinContext>();
            var authService     = new AuthService(fakeOwinContext.Object);

            // Act & Assert
            Assert.ThrowsAsync <ArgumentException>(async() => await authService.SignUpAsync(username: "******", email: "somemail", password: ""));
        }
Example #2
0
        public void ThrowsArgumentNullException_WhenEmail_IsNull()
        {
            // Arrange
            var fakeOwinContext = new Mock <IOwinContext>();
            var authService     = new AuthService(fakeOwinContext.Object);

            // Act & Assert
            Assert.ThrowsAsync <ArgumentNullException>(async() => await authService.SignUpAsync(username: "******", email: null, password: "******"));
        }