public void ListReleasesShouldBeValidAbsoluteUrl() { // Arrange var sut = new UpdateUrls(); // Act var actual = sut.ListReleases(); // Assert Assert.False(actual.IsAbsoluteUri); }
public void DownloadFileFromReleasesPackageShouldConstructCorrectAddress(string update, string fileName, string expectedAbsolute) { // Arrange var sut = new UpdateUrls(); // Act var actual = sut.DownloadFileFromReleasePackage(update, fileName); // Assert Assert.Equal(expectedAbsolute, actual.AbsoluteUri); }
public void BaseAddressOfShouldConstructCorrectAddresses(Uri address, string expectedAbsolute) { // Arrange var sut = new UpdateUrls(); // Act var actual = sut.BaseAddressOf(address); // Assert Assert.Equal(expectedAbsolute, actual.AbsoluteUri); }
public void BaseAddressForApiRequestsShouldBeValidUrl() { // Arrange var sut = new UpdateUrls(); // Act var actual = sut.BaseAddressForApiRequests(); // Assert Assert.True(actual.IsAbsoluteUri); }
public void RelativeFileDownloadUrlShouldBeValidRelativeUrl(Uri url, string expectedRelative) { // Arrange var sut = new UpdateUrls(); // Act var actual = sut.RelativeFileDownloadUrl(url); // Assert Assert.False(actual.IsAbsoluteUri); Assert.Equal(expectedRelative, actual.ToString()); }
// properties *are* initialized within the constructor. However by a method call, which is not correctly recognized by the code analyzer yet. #pragma warning disable CS8618 // warning about uninitialized non-nullable properties public MainViewModel(IViewProvider viewProvider) #pragma warning restore CS8618 { var pathResolver = new PathResolver(); _fileWatch = new FileWatchDistributedNotificationReceiver(pathResolver); _trayIcon = new TrayIconHandle(); _trayIcon.ExitRequested += TrayIconOnExitRequested; _trayIcon.ShowWindowRequested += TrayIconOnShowWindowRequested; var dispatcher = new WpfDispatcher(); _coreSetup = new CoreSetup(pathResolver, _fileWatch, dispatcher); _coreSetup.PipelineUpdated += CoreSetup_PipelineUpdated; _coreSetup.DistributedNotificationReceived += CoreSetup_DistributedNotificationReceived; _configurationApplication = new ConfigurationApplication(_coreSetup.Configuration); _configurationApplication.ApplyChanges(); GlobalErrorLogTarget.ErrorOccured += GlobalErrorLog_ErrorOccurred; _popupService = new PopupService(this, viewProvider); _windowSettings = new WindowSettings(pathResolver.WindowSettingsFilePath); _updateUrls = new UpdateUrls(); Initialize(); }