Exemple #1
0
        public void SettingAnInvalidScanResultDoesNotNavigateBack(string schema)
        {
            var navigation = A.Fake <INavigationService>();
            var device     = A.Fake <IPlatformSpecific>();
            var logging    = A.Fake <ILoggingService>();

            var viewModel = new QRScanPageViewModel(device, navigation, logging);

            viewModel.LastScanResult = new Result(
                schema,
                Array.Empty <byte>(),
                Array.Empty <ResultPoint>(),
                BarcodeFormat.QR_CODE);

            A.CallTo(() => navigation.GoBack()).MustNotHaveHappened();
        }
Exemple #2
0
        public void SettingAValidScanResultNavigatesBack()
        {
            var navigation = A.Fake <INavigationService>();
            var device     = A.Fake <IPlatformSpecific>();
            var logging    = A.Fake <ILoggingService>();

            var viewModel = new QRScanPageViewModel(device, navigation, logging);

            viewModel.LastScanResult = new Result(
                "wallabag://[email protected]",
                Array.Empty <byte>(),
                Array.Empty <ResultPoint>(),
                BarcodeFormat.QR_CODE);

            A.CallTo(() => navigation.GoBack()).MustHaveHappened();
        }