static void Main(string[] args) { SubclassB x = new SubclassB(); x.Changed(); Base y = new SubclassA(); y.Changed(); }
public string Result() { var a = new SubclassA(); var b = new SubclassB(); var c = new SubclassC(); var result = a.Output() + b.Output() + c.Output(); return(result); }
public void When_a_property_is_hidden_in_a_derived_class_it_should_ignore_it() { // Arrange var subject = new SubclassA <string> { Foo = "test" }; var expectation = new SubclassB <string> { Foo = "test" }; // Act Action action = () => subject.Should().BeEquivalentTo(expectation); // Assert action.Should().NotThrow(); }