public void AsITemplateRegistration_CreateTemplate_ShouldCorrectlyCreateATemplate() { // Arrange ITemplateRegistration registration = _registration; // Act var result = registration.CreateTemplate(_viewContext); // Assert result.Should().BeSameAs(_template.Object); }
public void AsITemplateRegistration_CreateTemplate_Throws_ArgumentNullException_WhenGivenNullViewContext() { // Arrange var paramName = "viewContext"; ITemplateRegistration registration = _registration; Action test = () => registration.CreateTemplate(null); // Act // Assert test.Should().Throw <ArgumentNullException>() .And.ParamName.Should().Be(paramName); }
public void AsITemplateRegistration_CreateTemplate_ShouldCorrectlyCreateATemplate() { // Arrange ITemplateRegistration registration = _registration; var expected = new TestTemplate(); _requestServices.Setup(m => m.GetService(typeof(TestTemplate))).Returns(expected); // Act var result = registration.CreateTemplate(_viewContext); // Assert result.Should().BeSameAs(expected); }