Esempio n. 1
0
        public async void in_hours_should_return_filtered_CheckCapacitySummaryResult()
        {
            var jObj = (JObject)JsonConvert.DeserializeObject(CheckCapacitySummaryResults);
            var results = jObj["CheckCapacitySummaryResult"].ToObject<List<Models.Models.Web.FromExternalServices.DosService>>();

            var fakeDoSFilteredCase = new DosFilteredCase() { PostCode = "So30 2Un", Disposition = 1008, DispositionTime = new DateTime(2016, 11, 23, 9, 30, 0), DispositionTimeFrameMinutes = 60 };
         
            var sut = new ServiceAvailablityManager(_mockConfiguration.Object).FindServiceAvailability(fakeDoSFilteredCase);
            //Act
            var result = sut.Filter(results);

            Assert.AreEqual(1, result.Count());
        }
Esempio n. 2
0
        public async void non_filtered_disposition_should_return_unfiltered_CheckCapacitySummaryResult()
        {
            var jObj    = (JObject)JsonConvert.DeserializeObject(CheckCapacitySummaryResults);
            var results = jObj["CheckCapacitySummaryResult"].ToObject <List <Models.Models.Business.DosService> >();

            var fakeDoSFilteredCase = new DosFilteredCase()
            {
                PostCode = "So30 2Un", Disposition = 1010
            };

            //Act
            var sut = new ServiceAvailablityManager(_mockConfiguration.Object).FindServiceAvailability(fakeDoSFilteredCase);
            //Act
            var result = sut.Filter(results);

            Assert.AreEqual(3, result.Count());
        }
Esempio n. 3
0
        public async void Dental_out_of_hours_traversing_in_hours_should_return_filtered_CheckCapacitySummaryResult()
        {
            var jObj    = (JObject)JsonConvert.DeserializeObject(CheckCapacitySummaryResults);
            var results = jObj["CheckCapacitySummaryResult"].ToObject <List <Models.Models.Business.DosService> >();

            var fakeDoSFilteredCase = new DosFilteredCase()
            {
                PostCode = "So30 2Un", Disposition = 1017, DispositionTime = new DateTime(2016, 12, 1, 22, 1, 0), DispositionTimeFrameMinutes = 1440
            };


            var sut = new ServiceAvailablityManager(_mockConfiguration.Object).FindServiceAvailability(fakeDoSFilteredCase);

            //Act
            var result = sut.Filter(results);

            //Assert

            Assert.AreEqual(1, result.Count());
        }
Esempio n. 4
0
        public async void Dental_No_Blacklited_Services_Returns_All_CheckCapacitySummaryResults()
        {
            _mockConfiguration.Setup(c => c.FilteredDentalDispositionCodes).Returns("");

            var jObj    = (JObject)JsonConvert.DeserializeObject(CheckCapacitySummaryResults);
            var results = jObj["CheckCapacitySummaryResult"].ToObject <List <Models.Models.Business.DosService> >();

            var fakeDoSFilteredCase = new DosFilteredCase()
            {
                PostCode = "So30 2Un", Disposition = 1017, DispositionTime = new DateTime(2016, 11, 23, 7, 31, 0), DispositionTimeFrameMinutes = 720
            };

            var sut = new ServiceAvailablityManager(_mockConfiguration.Object).FindServiceAvailability(fakeDoSFilteredCase);

            //Act
            var result = sut.Filter(results);

            //Assert

            Assert.AreEqual(3, result.Count());
        }