Esempio n. 1
0
        public void CreateAdmin()
        {
            // Arrange
            var                     controller     = new UserManagementController();
            UserCredential          credentials    = new UserCredential("ControllerTestUser", "Password123");
            Address                 address        = new Address("321 W. 119th St.", "Los Angeles", "California", "90061");
            List <SecurityQuestion> SecurityQandAs = new List <SecurityQuestion>();

            SecurityQandAs.Add(new SecurityQuestion("Who was the company you first worked for?", "This is an Answer to 1"));
            SecurityQandAs.Add(new SecurityQuestion("What is your favorite song?", "This is an Answer to 2"));
            SecurityQandAs.Add(new SecurityQuestion("What was the name of your first crush?", "This is an Answer to 3"));
            RegInfo obj = new RegInfo()
            {
                UserCredInfo   = credentials,
                UserLocation   = address,
                SecurityQandAs = SecurityQandAs
            };
            // Act
            IHttpActionResult actionResult = controller.CreateAdmin(obj);
            var contentResult = actionResult as OkNegotiatedContentResult <string>;

            // Assert
            Assert.NotNull(contentResult);
            Assert.NotNull(contentResult.Content);
            Assert.Equal("Success: Account was deleted for amay", contentResult.Content);
        }