public void CanCustomizeObjectUsingMultipleCustomizations() { var obj = new SampleClass(); Customization<SampleClass> greet = x => x.Text = "Hello, "; Customization<SampleClass> world = x => x.Text += "World!"; obj.Customize(greet, world); obj.Text.Should().Be("Hello, World!"); }
public void CustomizeObjectUsingNullFails() { var obj = new SampleClass(); var exception = Record.Exception( () => obj.Customize(null)); exception.Should().BeOfType<NullReferenceException>(); }
public void CustomizeObjectWithOneOfTheCustomizationsBeingNullFails() { var obj = new SampleClass(); var arrayOfCustomizationsContainingNull = new Customization<SampleClass>[] {null}; var exception = Record.Exception( () => obj.Customize(arrayOfCustomizationsContainingNull)); exception.Should().BeOfType<NullReferenceException>(); }
public void CustomizeObjectReturnsSameObject() { var obj = new SampleClass(); var resultObj = obj.Customize(x => x.Text = "foo bar"); resultObj.Should().BeSameAs(obj); }