Ejemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                MeasurementM   measurementVM  = new MeasurementM();
                ViewChangeDate viewChangeDate = null;

                measurementVM.ShowDateScreenAction += () =>
                {
                    try
                    {
                        viewChangeDate             = new ViewChangeDate();
                        viewChangeDate.DataContext = measurementVM;
                        viewChangeDate.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "App ShowDateScreenAction");
                        Application.Current.Shutdown();
                    }
                };

                ViewMeasurement view = new ViewMeasurement();
                view.DataContext = measurementVM;
                view.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "App Application_Startup");
                Application.Current.Shutdown();
            }
        }
Ejemplo n.º 2
0
        public void BuildCalendar_CityM_returnDays()
        {
            // arrange
            MeasurementM measurementVM = new MeasurementM();
            CityM        cityes        = new CityM();

            XmlSerializer xs = new XmlSerializer(typeof(Collection <CityM>));

            using (StreamReader rd = new StreamReader(Path.GetFullPath(@"..\..\") + "save.xml"))
            {
                Collection <CityM> Cityes = xs.Deserialize(rd) as Collection <CityM>;
                cityes = Cityes[0];
            }

            // act
            var result = measurementVM.BuildCalendar(cityes);
            var actual = result[0];

            // assert
            Assert.IsInstanceOfType(actual, typeof(DayM));
        }