コード例 #1
0
        public void Getting_absoulte_template_should_throw_wen_there_is_no_base_URI()
        {
            // given
            var type     = typeof(Collection <ModelWithTemplate>);
            var provider = new AttributeModelTemplateProvider();

            // then
            Assert.Throws <MissingTemplateException>(() => provider.GetAbsoluteTemplate(type));
        }
コード例 #2
0
        public void Getting_template_for_model_should_prefix_attribute_value_with_base()
        {
            // given
            var type     = typeof(ModelWithTemplate);
            var provider = new AttributeModelTemplateProvider(new FakeBaseUriProvider());

            // when
            var template = provider.GetAbsoluteTemplate(type);

            // then
            template.Should().Be("http://example.com/model/with/template");
        }