public void Build_ProtectedCtor_BuildsDefaultObject() { // Arrange FerrariBuilder builder = new FerrariBuilder(); // Act Car actual = builder.Build(); // Assert Assert.NotNull(actual); new { Color = Car.DefaultColor, NumDoors = default(int), Model = Car.DefaultModel }.ToExpectedObject().ShouldMatch(actual); }
public void Build_WithModifications_BuildsModifiedObject() { // Arrange FerrariBuilder builder = new FerrariBuilder() .WithColor(Color.Red) .WithNumDoors(NumDoors); // Act Car actual = builder.Build(); // Assert Assert.NotNull(actual); new { Color = Color.Red.Name, NumDoors, Model = Car.DefaultModel }.ToExpectedObject().ShouldMatch(actual); }