Exemplo n.º 1
0
        public IHttpActionResult GetLoginvsRegistered(string month, int year)
        {
            UADManager _uadManager = new UADManager();

            try
            {
                var result = _uadManager.GetLoginComparedToRegistered(month, year);
                return(Ok(result));
            }
            catch (HttpRequestException error) // Catch Logger Errors
            {
                _gngLoggerService.LogBadRequest("", "", url, error.ToString());
                return(BadRequest());
            }
        }
Exemplo n.º 2
0
        public void GetLoginComparedToRegistered_Pass()
        {
            // Arrange
            bool expected = true;
            bool actual   = false;
            var  expectedAverageLogins = "1.5";
            var  expectedMinLogin      = "******";
            var  expectedMaxLogin      = "******";
            var  expectedRegistered    = userService.GetRegisteredUserCount();
            // Act
            var test = uadManager.GetLoginComparedToRegistered("April", 1);

            if (test[0].Value.Equals(expectedAverageLogins) && test[1].Value.Equals(expectedMinLogin) && test[2].Value.Equals(expectedMaxLogin))
            {
                actual = true;
            }
            for (int i = 0; i < test.Count; i++)
            {
                Console.WriteLine(test[i].Date + ' ' + test[i].InfoType + ' ' + test[i].Value);
            }
            // Assert
            Assert.AreEqual(actual, expected);
        }