Ejemplo n.º 1
0
        public void GetAll_ReturnsAllEnumerationValuesForType()
        {
            //ARRANGE
            var expectedCount = DummyEnumerationClass.CountOf();

            //ACT
            var results = EnumerationBase.GetAll <DummyEnumerationClass>().Count();

            //ASSERT
            results.ShouldBe(expectedCount);
        }
Ejemplo n.º 2
0
            public GetRoomForRentAnnouncementsInputQuery Convert(GetRoomForRentAnnouncementsRequest source, GetRoomForRentAnnouncementsInputQuery destination,
                                                                 ResolutionContext context)
            {
                var roomType = source.RoomType.HasValue
                    ? EnumerationBase.GetAll <RoomTypeEnumeration>().SingleOrDefault(x =>
                                                                                     Equals(x, ConvertToRoomTypeEnumeration(source.RoomType.Value)))
                    : null;

                return(new GetRoomForRentAnnouncementsInputQuery(source.Page, source.PageSize, source.Sort,
                                                                 source.CreatedFrom, source.CreatedTo, source.CityId, source.PriceFrom, source.PriceTo,
                                                                 roomType, source.CityDistrict));
            }
Ejemplo n.º 3
0
 public static NumberOfRoomsEnumeration ConvertToNumberOfRoomsEnumeration(NumberOfRooms numberOfRooms)
 {
     return(EnumerationBase.GetAll <NumberOfRoomsEnumeration>()
            .SingleOrDefault(x => x.DisplayName.ToLower().Equals(numberOfRooms.ToString().ToLower())));
 }
Ejemplo n.º 4
0
 public static RoomTypeEnumeration ConvertToEnumeration(this RoomType?roomType)
 {
     return(!roomType.HasValue ?
            null :
            EnumerationBase.GetAll <RoomTypeEnumeration>().SingleOrDefault(x => x.DisplayName.ToLower().Equals(roomType.ToString().ToLower())));
 }
Ejemplo n.º 5
0
 public static TokenTypeEnumeration ConvertToEnumeration(this TokenType type)
 {
     return(EnumerationBase.GetAll <TokenTypeEnumeration>()
            .SingleOrDefault(x => x.DisplayName.ToLower().Equals(type.ToString().ToLower())));
 }
Ejemplo n.º 6
0
 public static AnnouncementSendingFrequencyEnumeration ConvertToEnumeration(this AnnouncementSendingFrequency announcementSendingFrequency)
 {
     return(EnumerationBase.GetAll <AnnouncementSendingFrequencyEnumeration>()
            .SingleOrDefault(x => x.DisplayName.ToLower().Equals(announcementSendingFrequency.ToString().ToLower())));
 }
Ejemplo n.º 7
0
 public static RoomTypeEnumeration ConvertToRoomTypeEnumeration(RoomType roomType)
 {
     return(EnumerationBase.GetAll <RoomTypeEnumeration>()
            .SingleOrDefault(x => x.DisplayName.ToLower().Equals(roomType.ToString().ToLower())));
 }