コード例 #1
0
        public void DoesUserExists_RightInput_ExpectDarthMaul()
        {
            ConnectionString = "Insert connection string here.";
            var user           = APICollector.ParseUserAsync("Darth Maul");
            var expectedResult = AccountManagement.Exists(user);

            Assert.True(expectedResult);
        }
コード例 #2
0
        public void ParseUserAsync_RightInput_ExpectBlue()
        {
            var user = APICollector.ParseUserAsync("Luke Skywalker");

            var expectedEyeColor = "blue";

            Assert.True(expectedEyeColor == user.EyeColor);
            //Assert.Equal(expectedEyeColor, user.eyeColor);
        }
コード例 #3
0
            public static User IdentifyWithQuestion(string username, Func <string, string> getSecurityAnswer)
            {
                var inputUser = APICollector.ParseUserAsync(username);

                if (inputUser == null)
                {
                    return(null);
                }

                var(question, answer) = GetSecurityQuestion(inputUser);
                var inputAnswer = getSecurityAnswer(question);

                if (inputAnswer.ToLower() == answer.ToLower())
                {
                    return(inputUser);
                }
                return(null);
            }