public void CodeElements_OneClassWithNoNamespaceInProject_ReturnsOneCodeClassItem() { CreateCodeModel(); AddClassToProjectContent(String.Empty, "TestClass"); CodeElements codeElements = codeModel.CodeElements; CodeClass2 codeClass = codeElements.FirstCodeClass2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("TestClass", codeClass.FullName); }
public void PartialClasses_ClassIsNotPartial_ReturnsClass() { CreateProjectContent(); CreatePublicClass("MyNamespace.MyClass"); CreateClass(); CodeElements partialClasses = codeClass.PartialClasses; CodeClass firstClass = partialClasses.FirstCodeClass2OrDefault(); Assert.AreEqual(1, partialClasses.Count); Assert.AreEqual(codeClass, firstClass); }
public void Members_NamespaceHasOneClass_ReturnsOneClass() { CreateProjectContent(); AddClassToProjectContent("Tests", "Tests.MyClass"); CreateCodeNamespace("Tests"); CodeElements members = codeNamespace.Members; CodeClass2 codeClass = members.FirstCodeClass2OrDefault(); Assert.AreEqual(1, members.Count); Assert.AreEqual("Tests.MyClass", codeClass.FullName); }
public void BaseTypes_ClassBaseTypeIsSystemObject_ReturnsSystemObject() { CreateProjectContent(); CreatePublicClass("MyClass"); AddBaseTypeToClass("System.Object"); CodeElements codeElements = codeClass.Bases; CodeClass2 baseClass = codeElements.FirstCodeClass2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("System.Object", baseClass.FullName); Assert.AreEqual("Object", baseClass.Name); }