Beispiel #1
0
        public void ToHospitalDetails_Should_Handle_Null()
        {
            HospitalObject source = null;
            var            actual = source.ToHospitalDetails();

            actual.Should().BeNull();
        }
Beispiel #2
0
 public static HospitalDetails ToHospitalDetails(this HospitalObject source)
 {
     return(source == null ? null : new HospitalDetails
     {
         Id = source.Id,
         Name = source.Name,
         Location = source.Location.ToLocationDetails(),
         Queue = source.WaitingList.ToQueueDetailsList()
     });
 }
Beispiel #3
0
        public void ToHospitalDetails_Should_Map_Correctly()
        {
            var source = new HospitalObject
            {
                Id          = 123,
                Name        = "name",
                Location    = new LocationObject(),
                WaitingList = new []
                {
                    new WaitingListObject(),
                    new WaitingListObject()
                }
            };

            var actual = source.ToHospitalDetails();

            actual.Id.Should().Be(source.Id);
            actual.Name.Should().Be(source.Name);
            actual.Location.Should().NotBeNull();
            actual.Queue.Should().HaveSameCount(source.WaitingList);
        }