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()); } }
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); }