Beispiel #1
0
        public void ShouldConvertDocumentToFileNameIfItIsSolutionExternal()
        {
            var documentMock = new Mock <Document>();

            documentMock.Setup(doc => doc.Language).Returns("Properties");
            documentMock.Setup(doc => doc.FullName).Returns(@"D:\My\Private\Stuff.Properties");
            documentMock.Setup(doc => doc.DTE)
            .Returns(
                MockDTE.CreateSolution(
                    @"C:\Users\Sven Amann\Documents\Projects\KaVE-Solution\Solution.sln")
                .DTE);

            var documentName = documentMock.Object.GetName();

            NameAssert.AreEqual(@"Properties Stuff.Properties", documentName);
        }
Beispiel #2
0
        public void ShouldConvertSolutionDocumentToRelativeName()
        {
            var documentMock = new Mock <Document>();

            documentMock.Setup(doc => doc.Language).Returns("Project");
            documentMock.Setup(doc => doc.FullName)
            .Returns(@"C:\Users\Sven Amann\Documents\Projects\KaVE-Solution\Project\Project.csproj");
            documentMock.Setup(doc => doc.DTE)
            .Returns(
                MockDTE.CreateSolution(
                    @"C:\Users\Sven Amann\Documents\Projects\KaVE-Solution\Solution.sln")
                .DTE);

            var documentName = documentMock.Object.GetName();

            NameAssert.AreEqual(@"Project \Project\Project.csproj", documentName);
        }