public void ThrowException_TrafficLogParamsNull()
        {
            var trafficLogFactory = MockServicesHelper.CreateTrafficLog();

            var startDateUtc = DateTime.UtcNow;
            var endDateUtc   = DateTime.UtcNow;

            Assert.Throws <ArgumentNullException>(() => trafficLogFactory.Create());
        }
        public void ResponseLogShouldBeNull()
        {
            var trafficLogFactory = MockServicesHelper.CreateTrafficLog();

            var mockTrafficLogParams =
                MockServicesHelper.CreateTrafficLogParams(out DateTime startDateUtc, out DateTime endDateUtc);

            var trafficLog = trafficLogFactory.Create(mockTrafficLogParams, ignoreResponse: true);

            Assert.NotNull(trafficLog);
            Assert.Null(trafficLog.Response);
        }
        public void ThrowException_ResponseLogNull()
        {
            var mockResponseFactory = new Mock <IResponseLogFactory>();

            mockResponseFactory.Setup(x => x.Create(It.IsAny <string>())).Returns((IResponseLog)null);

            var trafficLogFactory = MockServicesHelper.CreateTrafficLog(responseLogFactory: mockResponseFactory.Object);

            var mockTrafficLogParams =
                MockServicesHelper.CreateTrafficLogParams(out DateTime startDateUtc, out DateTime endDateUtc);

            Assert.Throws <NullReferenceException>(() => trafficLogFactory.Create(mockTrafficLogParams));
        }
        public void ThrowException_ClientIpAddressNull()
        {
            var mockIpAddressReader = new Mock <IIpAddressReader>();

            mockIpAddressReader.Setup(x => x.GetClientIpAddress()).Returns((string)null);

            var trafficLogFactory = MockServicesHelper.CreateTrafficLog(ipAddressReader: mockIpAddressReader.Object);

            var mockTrafficLogParams =
                MockServicesHelper.CreateTrafficLogParams(out DateTime startDateUtc, out DateTime endDateUtc);

            Assert.Throws <NullReferenceException>(() => trafficLogFactory.Create(mockTrafficLogParams));
        }
        public void ThrowException_MachineNameNull()

        {
            var mockMachineReader = new Mock <IMachineNameReader>();

            mockMachineReader.Setup(x => x.GetMachineName()).Returns((string)null);

            var trafficLogFactory = MockServicesHelper.CreateTrafficLog(machineNameReader: mockMachineReader.Object);

            var mockTrafficLogParams =
                MockServicesHelper.CreateTrafficLogParams(out DateTime startDateUtc, out DateTime endDateUtc);

            Assert.Throws <NullReferenceException>(() => trafficLogFactory.Create(mockTrafficLogParams));
        }