public void HierarchyCanBeCreated() { var parent = new ScopedEnclosings(); var sut = new ScopedEnclosings(parent); Assert.AreEqual(parent, sut.Parent); }
public void DefaultValues() { var sut = new ScopedEnclosings(); Assert.Null(sut.Parent); Assert.AreEqual(Names.UnknownType, sut.Type); Assert.AreEqual(Names.UnknownMethod, sut.Method); }
public void EnclosingsCanBeSet() { var sut = new ScopedEnclosings { Type = Type("T"), Method = Method("M") }; Assert.AreEqual(Type("T"), sut.Type); Assert.AreEqual(Method("M"), sut.Method); }
public void EnclosingsAreInferedFromHierarchy() { var parent = new ScopedEnclosings { Type = Type("T"), Method = Method("M") }; var sut = new ScopedEnclosings(parent); Assert.AreEqual(Type("T"), sut.Type); Assert.AreEqual(Method("M"), sut.Method); }
public void SettingEnclosingsDoesNotAffectHierarchy() { var parent = new ScopedEnclosings { Type = Type("T"), Method = Method("M") }; var sut = new ScopedEnclosings(parent) { Type = Type("T2"), Method = Method("M2") }; Assert.AreEqual(Type("T"), parent.Type); Assert.AreEqual(Method("M"), parent.Method); Assert.AreEqual(Type("T2"), sut.Type); Assert.AreEqual(Method("M2"), sut.Method); }