コード例 #1
0
        public void OnNameUpdate()
        {
            var project = new Mock<IProject>();
            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            bool eventRaised = false;
            facade.OnNameChanged += (s, e) => { eventRaised = true; };

            project.Raise(p => p.OnNameChanged += null, new ValueChangedEventArgs<string>("newName"));
            Assert.IsTrue(eventRaised);
        }
コード例 #2
0
        public void OnDatasetDeleted()
        {
            var project = new Mock<IProject>();
            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            bool eventRaised = false;
            facade.OnDatasetDeleted += (s, e) => { eventRaised = true; };

            project.Raise(p => p.OnDatasetDeleted += null, EventArgs.Empty);
            Assert.IsTrue(eventRaised);
        }
コード例 #3
0
        public void OnDatasetDeleted()
        {
            var project = new Mock <IProject>();
            var facade  = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            bool eventRaised = false;

            facade.OnDatasetDeleted += (s, e) => { eventRaised = true; };

            project.Raise(p => p.OnDatasetDeleted += null, EventArgs.Empty);
            Assert.IsTrue(eventRaised);
        }
コード例 #4
0
        public void OnSummaryUpdate()
        {
            var project = new Mock <IProject>();
            var facade  = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            bool eventRaised = false;

            facade.OnSummaryChanged += (s, e) => { eventRaised = true; };

            project.Raise(p => p.OnSummaryChanged += null, new ValueChangedEventArgs <string>("newSummary"));
            Assert.IsTrue(eventRaised);
        }
コード例 #5
0
        public void Root()
        {
            var project = new Mock <IProject>();
            {
                project.Setup(p => p.BaseDataset())
                .Returns(new Mock <IProxyDataset>().Object);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));
            var root   = facade.Root();

            Assert.IsNotNull(root);
        }
コード例 #6
0
        public void Name()
        {
            var project = new Mock<IProject>();
            {
                project.SetupProperty(p => p.Name);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            var name = "name";
            facade.Name = name;
            Assert.AreEqual(name, facade.Name);
        }
コード例 #7
0
        public void Summary()
        {
            var project = new Mock <IProject>();
            {
                project.SetupProperty(p => p.Summary);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            var summary = "text";

            facade.Summary = summary;
            Assert.AreEqual(summary, facade.Summary);
        }
コード例 #8
0
        public void Name()
        {
            var project = new Mock <IProject>();
            {
                project.SetupProperty(p => p.Name);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            var name = "name";

            facade.Name = name;
            Assert.AreEqual(name, facade.Name);
        }
コード例 #9
0
        public void Root()
        {
            var project = new Mock<IProject>();
            {
                project.Setup(p => p.BaseDataset())
                    .Returns(new Mock<IProxyDataset>().Object);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));
            var root = facade.Root();
            Assert.IsNotNull(root);
        }
コード例 #10
0
        public void Summary()
        {
            var project = new Mock<IProject>();
            {
                project.SetupProperty(p => p.Summary);
            }

            var facade = new ScriptFrontEndProjectFacade(new ScriptBackEndProjectFacade(new ProjectFacade(project.Object)));

            var summary = "text";
            facade.Summary = summary;
            Assert.AreEqual(summary, facade.Summary);
        }