コード例 #1
0
 public LinkPair(T view, T real)
 {
     ViewValidation.VerifyLinkedNotNull(view);
     ViewValidation.VerifyNotLinkedNotNull(real);
     this.View = view;
     this.Real = real;
 }
コード例 #2
0
            public ROTestCollectionGroup()
                : base(1, 0)
            {
                this.BigFile = this.ImmutableDisk.WriteProjectFile($"Big.proj", TestCollectionGroup.BigProjectFile);
                var projReal = this.Remote[0].LoadProjectWithSettings(this.BigFile, ProjectLoadSettings.IgnoreMissingImports | ProjectLoadSettings.RecordDuplicateButNotCircularImports);

                this.Local.Importing = true;
                Assert.NotNull(projReal);
                this.Real = projReal;
                Assert.NotNull(this.Real);
                var projView = this.Local.GetLoadedProjects(this.BigFile).FirstOrDefault();

                Assert.NotNull(projView);
                this.View = projView;

                ViewValidation.VerifyNotLinkedNotNull(this.Real);
                ViewValidation.VerifyLinkedNotNull(this.View);
            }
コード例 #3
0
            public ROTestCollectionGroup()
                : base(1, 0)
            {
                this.BigFile = this.ImmutableDisk.WriteProjectFile($"Big.proj", TestCollectionGroup.BigProjectFile);
                var projReal = this.Remote[0].LoadProjectIgnoreMissingImports(this.BigFile);

                this.Local.Importing = true;
                Assert.NotNull(projReal);
                this.RealXml = projReal.Xml;
                Assert.NotNull(this.RealXml);
                var projView = this.Local.GetLoadedProjects(this.BigFile).FirstOrDefault();

                Assert.NotNull(projView);
                this.ViewXml = projView.Xml;

                ViewValidation.VerifyNotLinkedNotNull(this.RealXml);
                ViewValidation.VerifyLinkedNotNull(this.ViewXml);
            }
コード例 #4
0
        public void EnumerationBasic()
        {
            var pcLocal  = this.StdGroup.Local;
            var pcRemote = this.StdGroup.Remote[0];

            var proj1Path = this.StdGroup.StdProjectFiles[0];
            var proj2Path = this.StdGroup.StdProjectFiles[1];

            var proj1 = pcLocal.LoadProject(proj1Path);
            var proj2 = pcRemote.LoadProject(proj2Path);

            ViewValidation.VerifyNotLinkedNotNull(proj1);
            ViewValidation.VerifyNotLinkedNotNull(proj2);

            var loadedLocal  = pcLocal.Collection.LoadedProjects;
            var loadedRemote = pcRemote.Collection.LoadedProjects;

            Assert.Equal(1, loadedLocal.Count);
            Assert.Equal(1, loadedRemote.Count);
            Assert.Same(proj1, loadedLocal.FirstOrDefault());
            Assert.Same(proj2, loadedRemote.FirstOrDefault());

            pcLocal.Importing = true;

            loadedLocal = pcLocal.Collection.LoadedProjects;
            Assert.Equal(2, loadedLocal.Count);

            // still can find it's own projects and it is the same object
            var localProj = pcLocal.Collection.GetLoadedProjects(proj1Path).FirstOrDefault();

            Assert.Same(localProj, proj1);

            var remoteProj = pcLocal.Collection.GetLoadedProjects(proj2Path).FirstOrDefault();

            Assert.NotSame(remoteProj, proj2);
            ViewValidation.VerifyLinkedNotNull(remoteProj);
        }