public void ComponentName( [Greedy] AutoUpdateComponent sut) { // ACT var result = sut.ComponentName; // ASSERT result.Should().Be("autoupdate"); }
public void DownloadLatestRelease( [Frozen] Mock <IHttpClient> httpClientMock, [Greedy] AutoUpdateComponent sut) { // ARRANGE httpClientMock.SetupApiCall(sut, CallType.Action, "downloadLatestRelease") .ReturnsOkResult() .Verifiable(); // ACT sut.DownloadLatestRelease(); // ASSERT httpClientMock.Verify(); }
public void GetOptionCheckOnStart( [Frozen] Mock <IHttpClient> httpClientMock, [Greedy] AutoUpdateComponent sut, bool value) { // ARRANGE var json = new JObject( new JProperty("CheckOnStart", value)); httpClientMock.SetupApiCall(sut, CallType.View, "optionCheckOnStart") .Returns(json.ToString()) .Verifiable(); // ACT var result = sut.GetOptionCheckOnStart(); // ASSERT result.Should().Be(value); httpClientMock.Verify(); }
public void GetLatestVersionNumber( [Frozen] Mock <IHttpClient> httpClientMock, [Greedy] AutoUpdateComponent sut, string latestVersionNumber) { // ARRANGE var json = new JObject( new JProperty("latestVersionNumber", latestVersionNumber)); httpClientMock.SetupApiCall(sut, CallType.View, "latestVersionNumber") .Returns(json.ToString()) .Verifiable(); // ACT var result = sut.GetLatestVersionNumber(); // ASSERT result.Should().Be(latestVersionNumber); httpClientMock.Verify(); }
public void SetOptionReportReleaseAddons( [Frozen] Mock <IHttpClient> httpClientMock, [Greedy] AutoUpdateComponent sut, bool value) { // ARRANGE httpClientMock.SetupApiCall(sut, CallType.Action, "optionReportReleaseAddons", new Parameters { { "Boolean", value } }) .ReturnsOkResult() .Verifiable(); // ACT sut.SetOptionReportReleaseAddons(value); // ASSERT httpClientMock.Verify(); }
public void IsLatestVersion( [Frozen] Mock <IHttpClient> httpClientMock, [Greedy] AutoUpdateComponent sut, bool isLatestVersion) { // ARRANGE var json = new JObject( new JProperty("isLatestVersion", isLatestVersion)); httpClientMock.SetupApiCall(sut, CallType.View, "isLatestVersion") .Returns(json.ToString()) .Verifiable(); // ACT var result = sut.IsLatestVersion(); // ASSERT result.Should().Be(isLatestVersion); httpClientMock.Verify(); }