示例#1
0
        public void Setup()
        {
            // Initilize Xamarin Forms
            MockForms.Init();

            //This is your App.xaml and App.xaml.cs, which can have resources, etc.
            app = new App();
            Application.Current = app;

            page = new ItemUpdatePage(new GenericViewModel <ItemModel>(new ItemModel()));
        }
示例#2
0
        public void ItemUpdatePage_Constructor_Default_Should_Pass()
        {
            // Arrange
            var ViewModel = new ItemViewModel();

            // Act
            var result = new ItemUpdatePage(ViewModel);

            // Reset

            // Assert
            Assert.IsNotNull(result);
        }
示例#3
0
        public void ItemUpdatePage_Cancel_Clicked_Default_Should_Pass()
        {
            // Arrange
            var ViewModel = new ItemViewModel();

            var page = new ItemUpdatePage(ViewModel);

            // Act
            page.Cancel_Clicked(null, null);

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
示例#4
0
        public void ItemUpdatePage_Value_OnStepperValueChanged_Default_Should_Pass()
        {
            // Arrange
            var ViewModel = new ItemViewModel();

            var    page     = new ItemUpdatePage(ViewModel);
            double oldValue = 0.0;
            double newValue = 1.0;

            var args = new ValueChangedEventArgs(oldValue, newValue);

            // Act
            page.Value_OnStepperValueChanged(null, args);

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
示例#5
0
        public void ItemUpdatePage_Damage_OnStepperDamageChanged_Default_Should_Pass()
        {
            // Arrange
            var data      = new ItemModel();
            var ViewModel = new GenericViewModel <ItemModel>(data);

            page = new ItemUpdatePage(ViewModel);
            double oldDamage = 0.0;
            double newDamage = 1.0;

            var args = new ValueChangedEventArgs(oldDamage, newDamage);

            // Act
            page.Damage_OnStepperValueChanged(null, args);

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }
示例#6
0
        public void ItemUpdatePage_Range_OnStepperValueChanged_Default_Should_Pass()
        {
            // Arrange
            var data      = new ItemModel();
            var ViewModel = new GenericViewModel <ItemModel>(data);

            page = new ItemUpdatePage(ViewModel);
            double oldRange = 0.0;
            double newRange = 1.0;

            Slider RangeSlider = (Slider)page.FindByName("RangeSlider");

            var args = new ValueChangedEventArgs(oldRange, newRange);

            // Act
            page.OnSliderChanged(RangeSlider, args);

            // Reset

            // Assert
            Assert.IsTrue(true); // Got to here, so it happened...
        }