public async Task GetShellAppRegistrationModelReturnsSuccess() { var fakeAppRegistryService = A.Fake <IAppRegistryService>(); A.CallTo(() => fakeAppRegistryService.GetPaths()).Returns(appRegistrationModels); var appRegistryDataService = new AppRegistryDataService(fakeAppRegistryService); var result = await appRegistryDataService.GetShellAppRegistrationModel().ConfigureAwait(false); Assert.Equal("shell", result.Path); }
public async Task GetPathReturnsFirstMatchingPathModelResult() { var fakeAppRegistryService = A.Fake <IAppRegistryService>(); A.CallTo(() => fakeAppRegistryService.GetPaths()).Returns(appRegistrationModels); var appRegistryDataService = new AppRegistryDataService(fakeAppRegistryService); var result = await appRegistryDataService.GetAppRegistrationModel("SecondFakePath").ConfigureAwait(false); Assert.Equal(appRegistrationModels[1], result); }
public async Task GetPathsReturnsPathModelResults() { var fakeAppRegistryService = A.Fake <IAppRegistryService>(); A.CallTo(() => fakeAppRegistryService.GetPaths()).Returns(appRegistrationModels); var appRegistryDataService = new AppRegistryDataService(fakeAppRegistryService); var result = await appRegistryDataService.GetAppRegistrationModels().ConfigureAwait(false); Assert.Equal(appRegistrationModels, result); }
public async Task SetAjaxRequestHealthStateForInvalidAjaxRequestSuccess() { // Arrange var fakeAppRegistryService = A.Fake <IAppRegistryService>(); A.CallTo(() => fakeAppRegistryService.GetPaths()).Returns(appRegistrationModels); var appRegistryDataService = new AppRegistryDataService(fakeAppRegistryService); // Act await appRegistryDataService.SetAjaxRequestHealthState(appRegistrationModels.First().Path, "unknown", true).ConfigureAwait(false); // Assert A.CallTo(() => fakeAppRegistryService.GetPaths()).MustHaveHappenedOnceExactly(); A.CallTo(() => fakeAppRegistryService.SetAjaxRequestHealthState(A <string> .Ignored, A <string> .Ignored, A <bool> .Ignored)).MustNotHaveHappened(); }
public async Task SetRegionHealthStateForInvalidRegionSuccess() { // Arrange var fakeAppRegistryService = A.Fake <IAppRegistryService>(); A.CallTo(() => fakeAppRegistryService.GetPaths()).Returns(appRegistrationModels); var appRegistryDataService = new AppRegistryDataService(fakeAppRegistryService); // Act await appRegistryDataService.SetRegionHealthState(appRegistrationModels.First().Path, PageRegion.Head, true); // Assert A.CallTo(() => fakeAppRegistryService.GetPaths()).MustHaveHappenedOnceExactly(); A.CallTo(() => fakeAppRegistryService.SetRegionHealthState(A <string> .Ignored, A <PageRegion> .Ignored, A <bool> .Ignored)).MustNotHaveHappened(); }