Example #1
0
        public void Given_a_catalogue_When_the_name_is_empty_it_fails()
        {
            var drupalCatalogue = CatalogueBuilder.Build();

            drupalCatalogue.Name = new List <FieldString>();

            Assert.ThrowsAny <Exception>(() => DrupalModelMapper.MapCatalogue(drupalCatalogue));
        }
Example #2
0
        public void Given_a_catalogue_it_maps_the_LastUpdated_from_UnixTimeSeconds_to_the_currespondent_DateTime()
        {
            var dateTime        = DateTime.UtcNow;
            var drupalCatalogue = CatalogueBuilder.Build().With_LastUpdateDateTime(dateTime);

            var result = DrupalModelMapper.MapCatalogue(drupalCatalogue);

            Assert.Equal(0, (int)(dateTime - result.LastUpdated).TotalSeconds);
        }
Example #3
0
        public void Given_a_catalogue_it_maps_the_Label_field_in_the_Type_in_as_the_Type_of_the_catalogue()
        {
            var type            = "OnlineSpecial";
            var drupalCatalogue = CatalogueBuilder.Build().With_Type(type);

            var result = DrupalModelMapper.MapCatalogue(drupalCatalogue);

            Assert.Equal(type, result.Type);
        }
Example #4
0
        public void Given_a_catalogue_it_maps_the_Name_in_asingle_flat_Name()
        {
            var name            = string.Empty;
            var drupalCatalogue = CatalogueBuilder.Build().With_Name(name);

            var result = DrupalModelMapper.MapCatalogue(drupalCatalogue);

            Assert.Equal(name, result.Name);
        }
Example #5
0
        public void Given_a_catalogue_it_maps_the_Id_in_asingle_flat_Id()
        {
            var catalogueId     = 123;
            var drupalCatalogue = CatalogueBuilder.Build().With_Id(catalogueId);

            var result = DrupalModelMapper.MapCatalogue(drupalCatalogue);

            Assert.Equal(catalogueId, result.Id);
        }