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())); }
public void ItemUpdatePage_Constructor_Default_Should_Pass() { // Arrange var ViewModel = new ItemViewModel(); // Act var result = new ItemUpdatePage(ViewModel); // Reset // Assert Assert.IsNotNull(result); }
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... }
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... }
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... }
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... }