コード例 #1
0
        public void ComponentName(
            [Greedy] AutoUpdateComponent sut)
        {
            // ACT
            var result = sut.ComponentName;

            // ASSERT
            result.Should().Be("autoupdate");
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }