Пример #1
0
        public async Task WithoutShowingConnectionString()
        {
            var versionResolver            = new StaticVersionResolverMock(new[] { new DependencyVersion(1, 0, 0) });
            ConnectedDependency dependency = new ConnectedDependency(versionResolver)
            {
                MinimumVersion             = new DependencyVersion(0, 0, 1),
                MaximumVersion             = new DependencyVersion(9, 9, 9),
                Name                       = "Test",
                ShowConnectionStringInJson = false,
                Type                       = SupportedDependencies.Service
            };
            var result = await dependency.ToJson();

            Assert.Null(result["value"]);
        }
Пример #2
0
        public async Task GetStatus_VersionsNotReturned()
        {
            var resolver = new StaticVersionResolverMock(new DependencyVersion[0]);
            var dep      = new ImplementedVersionedDependency(resolver)
            {
                MinimumVersion = new DependencyVersion(1),
                MaximumVersion = new DependencyVersion(2)
            };
            var status = await dep.GetStatus();

            Assert.Null(status.Version);
            // Support backwards compatibility
#pragma warning disable CS0618 // Type or member is obsolete
            Assert.False(status.CheckPassed);
#pragma warning restore CS0618 // Type or member is obsolete
            Assert.Equal(NAMEStatusLevel.Warn, status.CheckStatus);
            Assert.Null(status.InnerException);
        }