public void DifferentSourceNamespace_CreatesTargetClassWithDifferentNamespace()
            {
                var sourceProject = new SourceWebProject
                {
                    WebPageList = new List <SourceWebPage>()
                    {
                        new SourceWebPage
                        {
                            ClassFullName = "SomeOtherNamespace.Test1.TestItem",
                            PageUrl       = "TestWebPage.aspx"
                        }
                    },
                    RootNamespace = "TestSourceNamespace"
                };

                var targetProject = new TargetProject
                {
                    RootNamespace = "TestTargetNamespace"
                };
                var targetModelGenerator = new TargetModelGenerator();
                var projectResult        = targetModelGenerator.CompareProject(targetProject, sourceProject);

                Assert.AreEqual(1, projectResult.ClassesToAdd.Count);
                Assert.AreEqual(0, projectResult.ClassesToUpdate.Count);
                TestValidators.ValidateTargetClassComparisonResult(projectResult.ClassesToAdd[0],
                                                                   @"Client\Pages\SomeOtherNamespace\Test1\TestItemPageClient.designer.cs",
                                                                   @"Client\Pages\SomeOtherNamespace\Test1\TestItemPageClient.cs",
                                                                   @"SomeOtherNamespace.Test1.TestItem",
                                                                   @"TestTargetNamespace.Client.Pages.SomeOtherNamespace.Test1.TestItemPageClient",
                                                                   EnumSourceObjectType.WebPage,
                                                                   "TestWebPage.aspx");
            }
            public void MatchingSourceNamespace_CreatesTargetClassWithSameNamespace()
            {
                var sourceProject = new SourceWebProject
                {
                    WebPageList = new List <SourceWebPage>()
                    {
                        new SourceWebPage
                        {
                            ClassFullName = "TestTargetNamespace.Test1.TestItem",
                            PageUrl       = "TestWebPage.aspx"
                        }
                    },
                    RootNamespace = "TestSourceNamespace"
                };

                var targetProject = new TargetProject
                {
                    RootNamespace = "TestTargetNamespace.Test1"
                };
                var targetModelGenerator = new TargetModelGenerator();
                var projectResult        = targetModelGenerator.CompareProject(targetProject, sourceProject);

                Assert.AreEqual(1, projectResult.ClassesToAdd.Count);
                Assert.AreEqual(0, projectResult.ClassesToUpdate.Count);
                TestValidators.ValidateTargetClassComparisonResult(classResult: projectResult.ClassesToAdd[0],
                                                                   designerFileRelativePath: @"Client\Pages\TestTargetNamespace\Test1\TestItemPageClient.designer.cs",
                                                                   userFileRelativePath: @"Client\Pages\TestTargetNamespace\Test1\TestItemPageClient.cs",
                                                                   sourceClassFullName: @"TestTargetNamespace.Test1.TestItem",
                                                                   targetClassFullName: @"TestTargetNamespace.Test1.Client.Pages.TestTargetNamespace.Test1.TestItemPageClient",
                                                                   targetObjectType: EnumSourceObjectType.WebPage,
                                                                   expectedUrl: "TestWebPage.aspx");
            }
            public void ExistingTargetClassWithDifferentName_ShouldUpdateExistingTargetClass()
            {
                var sourceProject = new SourceWebProject
                {
                    WebPageList = new List <SourceWebPage>()
                    {
                        new SourceWebPage
                        {
                            ClassFullName = "TestSourceNamespace.Test1.TestItem",
                            PageUrl       = "TestWebPage.aspx"
                        }
                    },
                    RootNamespace = "TestSourceNamespace"
                };

                var targetProject = new TargetProject
                {
                    RootNamespace   = "TestTargetNamespace",
                    TargetClassList = new List <TargetClass>()
                    {
                        new TargetClass
                        {
                            SourceClassFullName      = "TestSourceNamespace.Test1.TestItem",
                            DesignerFileRelativePath = @"SomeOtherLocation\SomeOtherClassName.designer.cs",
                            UserFileRelativePath     = @"SomeOtherLocation\SomeOtherClassName.cs",
                            TargetClassFullName      = "SomeOtherLocation.SomeOtherClassName",
                            SourceObjectType         = EnumSourceObjectType.WebPage,
                            ExpectedUrl = "TestWebPage.aspx"
                        }
                    }
                };
                var targetModelGenerator = new TargetModelGenerator();
                var projectResult        = targetModelGenerator.CompareProject(targetProject, sourceProject);

                Assert.AreEqual(0, projectResult.ClassesToAdd.Count);
                Assert.AreEqual(1, projectResult.ClassesToUpdate.Count);
                TestValidators.ValidateTargetClassComparisonResult(projectResult.ClassesToUpdate[0],
                                                                   @"SomeOtherLocation\SomeOtherClassName.designer.cs",
                                                                   @"SomeOtherLocation\SomeOtherClassName.cs",
                                                                   "TestSourceNamespace.Test1.TestItem",
                                                                   "SomeOtherLocation.SomeOtherClassName",
                                                                   EnumSourceObjectType.WebPage,
                                                                   "TestWebPage.aspx");
            }
            public void ExistingTargetClassWithExpectedNameAndLocation_ShouldUpdateExistingClass()
            {
                var sourceProject = new SourceWebProject
                {
                    WebPageList = new List <SourceWebPage>()
                    {
                        new SourceWebPage
                        {
                            ClassFullName = "TestSourceNamespace.Test1.TestItem",
                            PageUrl       = "TestWebPage.aspx"
                        }
                    },
                    RootNamespace = "TestSourceNamespace"
                };

                var targetProject = new TargetProject
                {
                    RootNamespace   = "TestTargetNamespace",
                    TargetClassList = new List <TargetClass>()
                    {
                        new TargetClass
                        {
                            SourceClassFullName      = "TestSourceNamespace.Test1.TestItem",
                            DesignerFileRelativePath = @"Client\Pages\Test1\TestItemPageClient.designer.cs",
                            UserFileRelativePath     = @"Client\Pages\Test1\TestItemPageClient.cs",
                            TargetClassFullName      = "TestTargetNamespace.Client.Pages.Test1.TestItemPageClient",
                            SourceObjectType         = EnumSourceObjectType.WebPage,
                            ExpectedUrl = "TestWebPage.aspx"
                        }
                    }
                };
                var targetModelGenerator = new TargetModelGenerator();
                var projectResult        = targetModelGenerator.CompareProject(targetProject, sourceProject);

                Assert.AreEqual(0, projectResult.ClassesToAdd.Count);
                Assert.AreEqual(1, projectResult.ClassesToUpdate.Count);
            }