Exemplo n.º 1
0
            public void CheckOnlineAvailabilityFullResultIfAllBusinessesMarkedMinStayCriteriaNotMet()
            {
                // Arrange
              
                AvailabilitySearchResult searchResult = new AvailabilitySearchResult
                {
                    BusinessCandidates = new List<AvailabilityResultBusiness> { new AvailabilityResultBusiness
                    {
                        BusinessId = 1,
                        UnavailabilityReasonCode = UnavailabilityReasonCode.MinStayCriteriaNotMet
                        
                    },
                    new AvailabilityResultBusiness
                    {
                        BusinessId = 2,
                        UnavailabilityReasonCode = UnavailabilityReasonCode.NoInventory
                    },
                    },
                    UnavailabilityReasonCode = null
                };

                var onlineSearchManager = new AvailabilityManager();

                var results = onlineSearchManager.FilterSearchResultsForOnlineCheckAvailability(searchResult);
                Assert.AreEqual(UnavailabilityReasonCode.MinStayCriteriaNotMet, results.UnavailabilityReasonCode, "Result UnavailabilityReasonCode should be MinStayCriteriaNotMet");
            }
Exemplo n.º 2
0
            public void CheckOnlineAvailabilityBusinessCandidateIfNoRoomsAvailableThenGetFirstUnavalailableReason()
            {
                // Arrange
                const long BUSINESS_ID = 500;
                const string BUSINESS_NAME = "EVO";

                // room types
                var roomTypes = Get6RoomTypesWithNullUnAvailabilityReasonCode(BUSINESS_ID);
                roomTypes.ForEach(x => x.UnAvailabilityReasonCode = UnavailabilityReasonCode.NoRateDefined);
                roomTypes[0].UnAvailabilityReasonCode = UnavailabilityReasonCode.MaxAdultExceeded;
                roomTypes[1].UnAvailabilityReasonCode = UnavailabilityReasonCode.MaxOccupancyExceeded;
                roomTypes[2].UnAvailabilityReasonCode = UnavailabilityReasonCode.MaxChildrenExceeded;
                AvailabilitySearchResult searchResult = new AvailabilitySearchResult
                {
                    BusinessCandidates = new List<AvailabilityResultBusiness> { new AvailabilityResultBusiness
                    {
                        BusinessId = BUSINESS_ID,
                        ShortName = BUSINESS_NAME,
                        RoomTypes = roomTypes,
                        UnavailabilityReasonCode = null
                    } },
                    UnavailabilityReasonCode = null
                };

                var onlineSearchManager = new AvailabilityManager();

                var results = onlineSearchManager.FilterSearchResultsForOnlineCheckAvailability(searchResult);
                Assert.AreEqual(UnavailabilityReasonCode.MaxOccupancyExceeded, results.BusinessCandidates[0].UnavailabilityReasonCode, "BusinessCandidates UnavailabilityReasonCode should be MaxOccupancyExceeded");

            }
Exemplo n.º 3
0
            public void CheckOnlineAvailabilityBusinessCandidateIfSomeRoomsAvailableDontSetUnavailabilityReason()
            {
                // Arrange
                const long BUSINESS_ID = 500;
                const string BUSINESS_NAME = "EVO";

                // room types
                var roomTypes = Get6RoomTypesWithNullUnAvailabilityReasonCode(BUSINESS_ID);
              
                roomTypes[0].UnAvailabilityReasonCode = UnavailabilityReasonCode.MaxOccupancyExceeded;
                roomTypes[1].UnAvailabilityReasonCode = UnavailabilityReasonCode.MaxAdultExceeded;
                roomTypes[2].UnAvailabilityReasonCode = UnavailabilityReasonCode.CheckInNotPossible;
                AvailabilitySearchResult searchResult = new AvailabilitySearchResult
                {
                    BusinessCandidates = new List<AvailabilityResultBusiness> { new AvailabilityResultBusiness
                    {
                        BusinessId = BUSINESS_ID,
                        ShortName = BUSINESS_NAME,
                        RoomTypes = roomTypes,
                        UnavailabilityReasonCode = null
                    } },
                    UnavailabilityReasonCode = null
                };

                var onlineSearchManager = new AvailabilityManager();

                var results = onlineSearchManager.FilterSearchResultsForOnlineCheckAvailability(searchResult);
                Assert.IsNull(results.BusinessCandidates[0].UnavailabilityReasonCode, "BusinessCandidates UnavailabilityReasonCode should be null");

            }
Exemplo n.º 4
0
            public void CheckOnlineAvailabilityBusinessCandidateAllRoomsNoInventoryThenNoInventory()
            {
                 // Arrange
                    const long BUSINESS_ID = 500;
                    const string BUSINESS_NAME = "EVO";

                    // room types
                 var  roomTypes = Get6RoomTypesWithNullUnAvailabilityReasonCode(BUSINESS_ID);
                roomTypes.ForEach(x=>x.UnAvailabilityReasonCode = UnavailabilityReasonCode.NoRateDefined);

                    AvailabilitySearchResult searchResult = new AvailabilitySearchResult
                    {
                        BusinessCandidates = new List<AvailabilityResultBusiness> { new AvailabilityResultBusiness
                    {
                        BusinessId = BUSINESS_ID,
                        ShortName = BUSINESS_NAME,
                        RoomTypes = roomTypes,
                        UnavailabilityReasonCode = null
                    } },
                      UnavailabilityReasonCode = null
                    };

                 var onlineSearchManager = new AvailabilityManager();

                var results = onlineSearchManager.FilterSearchResultsForOnlineCheckAvailability(searchResult);
                Assert.AreEqual(UnavailabilityReasonCode.NoInventory, results.BusinessCandidates[0].UnavailabilityReasonCode, "BusinessCandidates UnavailabilityReasonCode should be MinStayCriteriaNotMet");

            }