public void WithType_Where_Type_Is_Null() { // arrange var location = new Location(1, 1, 1, 1); var initialType = new NamedTypeNode("abc"); var type = new ListTypeNode(location, initialType); // act Action action = () => type.WithType(null); // assert Assert.Throws <ArgumentNullException>(action); }
public void WithType() { // arrange var location = new Location(1, 1, 1, 1); var initialType = new NamedTypeNode("abc"); var type = new ListTypeNode(location, initialType); // act var newType = new NamedTypeNode("def"); type = type.WithType(newType); // assert Assert.Equal(location, type.Location); Assert.Equal(newType, type.Type); }