예제 #1
0
        public async void CorrectUrlAndVersionIsReturnedWhenNewVersionIsAvailable()
        {
            //Given
            var         latestVersion = new Version(1, 0, 0, 3);
            var         expectedUrl   = "http://www.github.com/Devoney/CreateMask/Releases/" + latestVersion;
            ReleaseInfo releaseInfo   = null;
            var         items         = Given(info =>
            {
                releaseInfo = info;
            }, latestVersion);
            var releaseManager     = items.Item1;
            var args               = items.Item2;
            var releasesClientMock = items.Item3;

            //When
            await releaseManager.CheckForNewReleaseAsync(args);

            //Then
            releasesClientMock.Verify(m => m.GetAll(It.IsAny <string>(), It.IsAny <string>()), Times.Once, "It is expected that the releases are queried by the client.");
            releaseInfo.Should().NotBeNull();
            releaseInfo.Version.Should().BeEquivalentTo(latestVersion);
            releaseInfo.Uri.ToString().Should().Be(expectedUrl);
        }