public async Task Check ( UomItemPageModel expectedPage, UomItemPage actualPage ) { Assert.AreEqual(expectedPage.TitleText, actualPage.Title, "UomItemPage Title bad"); Assert.AreEqual(expectedPage.Name, actualPage.NameEntry.Text, "UomItemPage Name bad"); Assert.AreEqual(expectedPage.Description, actualPage.DescriptionEntry.Text, "UomItemPage Description bad"); }
public async Task BackButtonPressed() { var mocks = new ItemPageControllerMocks <Uom>(); MockForms.Init(); var page = new UomItemPage(); page.InitializePage(); mocks.LrpNavigation.Setup(n => n.PopAsync()).ReturnsAsync(page); BuildController(mocks, page); await page.OnBackButtonPressedAsync(); }
public async Task InitializeAdd() { var mocks = new ItemPageControllerMocks <Uom>(); MockForms.Init(); var page = new UomItemPage(); page.InitializePage(); mocks.ViewModel.Setup(v => v.GetItemAsync(0)).Returns(Task.CompletedTask); var controller = BuildController(mocks, page); await controller.InitializeAddAsync(); }
public async Task SaveClicked_BadRequest() { var mocks = new ItemPageControllerMocks <Uom>(); MockForms.Init(); var page = new UomItemPage(); page.InitializePage(); mocks.ViewModel.Setup(v => v.SaveAsync()).Throws(new BadRequestHttpException()); BuildController(mocks, page); await page.SaveToolbarItemClickedAsync(); }
public async Task SaveClicked() { var mocks = new ItemPageControllerMocks <Uom>(); MockForms.Init(); var page = new UomItemPage(); page.InitializePage(); var sequence = new MockSequence(); mocks.ViewModel.InSequence(sequence).Setup(v => v.SaveAsync()).Returns(Task.CompletedTask); mocks.LrpNavigation.InSequence(sequence).Setup(n => n.PopAsync()).ReturnsAsync(page); BuildController(mocks, page); await page.SaveToolbarItemClickedAsync(); }
public async Task InitializeEdit_Item_Null() { var mocks = new ItemPageControllerMocks <Uom>(); MockForms.Init(); var page = new UomItemPage(); page.InitializePage(); var controller = BuildController(mocks, page); Assert.ThrowsAsync <ArgumentNullException> ( async() => await controller.InitializeEditAsync(null) ); }