public IHttpActionResult GetAverageSessionDuration(string month, int year)
        {
            UADManager _uadManager = new UADManager();

            try
            {
                var result = _uadManager.GetAverageSessionDuration(month, year);
                return(Ok(result));
            }
            catch (HttpRequestException error)
            {
                _gngLoggerService.LogBadRequest("", "", url, error.ToString());
                return(BadRequest());
            }
        }
Exemple #2
0
        public void GetAverageSessionDuration_Pass()
        {
            // Arrange
            bool expected = true;
            bool actual   = false;
            var  expectedAverageSession = "180";
            var  expectedMinSession     = "60";
            var  expectedMaxSession     = "300";

            // Act
            var test = uadManager.GetAverageSessionDuration("June", 1);

            if (expectedAverageSession == test[6].Value && expectedMinSession == test[7].Value && expectedMaxSession == test[8].Value)
            {
                actual = true;
            }
            // Assert
            Assert.AreEqual(actual, expected);
        }