public void Getting_template_for_model_should_throw_if_template_isnt_found() { // given var type = typeof(AttributeModelTemplateProviderTests); var provider = new AttributeModelTemplateProvider(); // when var ex = Assert.Throws <MissingTemplateException>(() => provider.GetTemplate(type)); // then ex.Message.Should().Be($"Template not found for type {type.FullName}"); }
public void Getting_template_for_Hydra_collection_should_retrieve_it_from_attribute() { // given var type = typeof(Collection <ModelWithTemplate>); var provider = new AttributeModelTemplateProvider(); // when var template = provider.GetTemplate(type); // then template.Should().Be("multiple/models"); }
public void Getting_template_for_model_should_retrieve_it_from_attribute() { // given var type = typeof(ModelWithTemplate); var provider = new AttributeModelTemplateProvider(); // when var template = provider.GetTemplate(type); // then template.Should().Be("model/with/template"); }