Beispiel #1
0
        public async Task Populate_WhenServiceIsConfigured_WillRunAPingResult()
        {
            MockSubsonicService.SetHasValidSubsonicUrl(true);
            var mockPingResult = new MockPingResult();
            var callCount      = 0;

            MockSubsonicService.Ping = () =>
            {
                callCount++;
                return(mockPingResult);
            };

            await Subject.Populate();

            callCount.Should().Be(1);
            mockPingResult.ExecuteCallCount.Should().Be(1);
        }
Beispiel #2
0
        public async Task Populate_PingResultHasError_CallsErrorDialogViewModelHandle()
        {
            MockSubsonicService.SetHasValidSubsonicUrl(true);
            var apiException = new ApiException(new Error {
                Message = "test_m"
            });
            var mockPingResult = new MockPingResult {
                GetErrorFunc = () => apiException
            };

            MockSubsonicService.Ping = () => mockPingResult;

            await Subject.Populate();

            MockErrorDialogViewModel.HandledErrors.Count().Should().Be(1);
            MockErrorDialogViewModel.HandledErrors.First().Should().Be(apiException);
        }