Пример #1
0
        protected override void Act()
        {
            //setup
            var section = MainSource.GetSection(SectionInChildSource1);

            MainSource.DoSourceChanged(new[] { ConfigurationSourceSection.SectionName });
        }
Пример #2
0
        protected override void Act()
        {
            //setup
            var section = MainSource.GetSection(SectionInChildSource1);

            CompositionHandler.Dispose();
        }
Пример #3
0
        protected override void Act()
        {
            DummySection dummySectionBeforeChange = (DummySection)MainSource.GetSection(SectionInChildSource1);

            var sourcesSection = CreateConfigurationSourceSection();
            var redirect       = sourcesSection.RedirectedSections.Where(x => x.Name == SectionInChildSource1).First();

            redirect.SourceName = "Source2";

            MainSource.Remove(ConfigurationSourceSection.SectionName);
            MainSource.Add(ConfigurationSourceSection.SectionName, sourcesSection);
            MainSource.DoSourceChanged(new [] { ConfigurationSourceSection.SectionName });


            try
            {
                MainSource.GetSection(SectionInChildSource1);
                Assert.Fail(); // Getting here indicates the section is still in original source
            }
            catch (ConfigurationSourceErrorsException)
            {
                // not caught intentionally
            }

            ChildSource2 = (TestConfigurationSource)CompositionHandler["Source2"];
            ChildSource2.Add(SectionInChildSource1, new DummySection {
                Name = "SectionInSource2"
            });
        }
Пример #4
0
    public void MainTheme()
    {
        MainSource.loop = false;
        MainSource.DOFade(0, 1f);

        OneShot.clip = _MainTheme;
        OneShot.loop = true;

        OneShot.Play();
    }
Пример #5
0
        protected override void Act()
        {
            DummySection dummySectionBeforeChange = (DummySection)MainSource.GetSection(SectionInChildSource1);

            ChildSource1.Remove(SectionInChildSource1);
            ChildSource1.Add(SectionInChildSource1, new DummySection {
                Name = "new name", Value = 16
            });
            ChildSource1.DoSourceChanged(new[] { SectionInChildSource1 });
        }
Пример #6
0
 protected void updateButton_Click(object sender, EventArgs e)
 {
     try {
         MainSource.UpdateParameters["EmployeeID"].DefaultValue = navigateComboBox.Value.ToString();
         MainSource.Update();
     }
     catch (Exception ex) {
         errorMessageLabel.Text    = ex.Message;
         errorMessageLabel.Visible = true;
     }
 }
Пример #7
0
        public void Then_CompositeConfigurationSourceStillListensToSectionChangedOnSubordinateSource()
        {
            bool called = false;

            MainSource.AddSectionChangeHandler(SectionInChildSource1, (sender, args) => called = true);


            ChildSource1 = (TestConfigurationSource)CompositionHandler["Source1"];
            ChildSource1.DoSourceSectionChanged(SectionInChildSource1);

            Assert.IsTrue(called);
        }
Пример #8
0
        private void SetTableView(bool showHeaderPicker)
        {
            var source = new MainSource(_tableView, ViewModel.PodcastDetail, ViewModel.LocationResources, ViewModel.SelectedCategory, showHeaderPicker);

            _tableView.Source = source;

            source.OnHeaderPressedEvent -= Source_OnHeaderPressedEvent;
            source.OnHeaderPressedEvent += Source_OnHeaderPressedEvent;
            source.OnOpenPodcastEvent   -= Source_OnOpenPodcastEvent;
            source.OnOpenPodcastEvent   += Source_OnOpenPodcastEvent;

            _tableView.ReloadData();
            _tableView.SetContentOffset(new CGPoint(0, 0), false);
        }
Пример #9
0
        public void Then_MainSourceKeepsRaisingEventsAfterReset()
        {
            TestConfigurationSource.ConfigurationSourceContents["section1"] = new DummySection();

            //force reset
            MainSource.DoSourceChanged(new [] { ConfigurationSourceSection.SectionName });
            Assert.AreEqual(1, CompositionHandler.RefreshCallCount);
            this.MainSourceEventListener.ConfigurationSourceChangedRaiseCount = 0; //reset counter

            var childSource = (TestConfigurationSource)CompositionHandler["Source1"];

            childSource.DoSourceChanged(new[] { "section1" });

            Assert.IsTrue(MainSourceEventListener.ConfigurationSourceChangedRaiseCount > 0);
        }
Пример #10
0
 public override bool Equals(object obj)
 {
     if (obj is SelectStatement statement)
     {
         return(Kind == statement.Kind &&
                Class == statement.Class &&
                OutputColumns.SequenceEqual(statement.OutputColumns) &&
                (MainSource == statement.MainSource || MainSource.Equals(statement.MainSource)) &&
                (FilterConditions == statement.FilterConditions || FilterConditions.Equals(statement.FilterConditions)) &&
                OutputOrder.SequenceEqual(statement.OutputOrder));
     }
     else
     {
         return(false);
     }
 }
Пример #11
0
 public void Then_SectionCanBeAccessedFromMainSource()
 {
     DummySection sectionFromMainSource = (DummySection)MainSource.GetSection(SectionInChildSource1);
 }
Пример #12
0
        public void Then_CompositeSourceReturnsUpdatedSectionFromOtherSource()
        {
            DummySection dummySectionAfterChange = (DummySection)MainSource.GetSection(SectionInChildSource1);

            Assert.AreEqual("SectionInSource2", dummySectionAfterChange.Name);
        }
Пример #13
0
        private void Button_Shutdown_Click(object sender, RoutedEventArgs e)
        {
            MainSource aa = new MainSource();

            aa.SendMessageShutdown(lst.ToArray());
        }
Пример #14
0
 protected override void Act()
 {
     MainSource.Remove(SectionInChildSource1);
     MainSource.Add(SectionInChildSource1, section);
 }
Пример #15
0
        public void then_does_not_throw_on_unregistered_missing_sections()
        {
            ConfigurationSection section = MainSource.GetSection("UnregisteredSection");

            Assert.IsNull(section);
        }
Пример #16
0
 public void then_throws_on_registered_but_missing_sections()
 {
     ConfigurationSection section = MainSource.GetSection("SectionInSource2");
 }
Пример #17
0
        public void Then_CompositeSourceReturnsUpdatedConfigurationSection()
        {
            DummySection dummySectionAfterChange = (DummySection)MainSource.GetSection(SectionInChildSource1);

            Assert.AreEqual("new name", dummySectionAfterChange.Name);
        }