예제 #1
0
        public IHttpActionResult GetLoginSuccessFail(string month, int year)
        {
            UADManager _uadManager = new UADManager();

            try
            {
                var result = _uadManager.GetLoginSuccessFail(month, year);
                return(Ok(result));
            }
            catch (HttpRequestException error) // Catch Logger Errors
            {
                _gngLoggerService.LogBadRequest("", "", url, error.ToString());
                return(BadRequest());
            }
        }
예제 #2
0
        public void GetLoginSuccessFail_Pass()
        {
            // Arrange
            bool expected = true;
            bool actual   = false;
            var  expectedSuccessfulLogins = "3";
            var  expectedFailLogins       = "1";
            // Act
            var test = uadManager.GetLoginSuccessFail("June", 1);

            if (test[4].Value.CompareTo(expectedSuccessfulLogins) == 0 && test[5].Value.CompareTo(expectedFailLogins) == 0)
            {
                actual = true;
            }
            // Assert
            Assert.AreEqual(actual, expected);
        }