コード例 #1
0
        public async Task GetProviderAsync_ReturnsNonNullGenerator()
        {
            var remoteDebuggerAuthenticationService = IRemoteDebuggerAuthenticationServiceFactory.Create();

            var provider  = new AuthenticationModeEnumProvider(remoteDebuggerAuthenticationService);
            var generator = await provider.GetProviderAsync(options : null);

            Assert.NotNull(generator);
        }
コード例 #2
0
        public async Task TryCreateEnumValueAsync_Throws()
        {
            var remoteDebuggerAuthenticationService = IRemoteDebuggerAuthenticationServiceFactory.Create();

            var provider  = new AuthenticationModeEnumProvider(remoteDebuggerAuthenticationService);
            var generator = await provider.GetProviderAsync(options : null);

            await Assert.ThrowsAsync <NotImplementedException>(() => generator.TryCreateEnumValueAsync("MyMode"));
        }
コード例 #3
0
        public async Task TryCreateEnumValueAsync_ReturnsNull()
        {
            var remoteDebuggerAuthenticationService = IRemoteDebuggerAuthenticationServiceFactory.Create();

            var provider  = new AuthenticationModeEnumProvider(remoteDebuggerAuthenticationService);
            var generator = await provider.GetProviderAsync(options : null);

            Assert.Null(await generator.TryCreateEnumValueAsync("MyMode"));
        }
コード例 #4
0
        public async Task GetListValuesAsync_ReturnsPageNamesAndDisplayNames()
        {
            var remoteDebuggerAuthenticationService = IRemoteDebuggerAuthenticationServiceFactory.Create(
                IRemoteAuthenticationProviderFactory.Create("cheetah", "Fast authentication!"),
                IRemoteAuthenticationProviderFactory.Create("tortoise", "Sloooow authentication..."));

            var provider  = new AuthenticationModeEnumProvider(remoteDebuggerAuthenticationService);
            var generator = await provider.GetProviderAsync(options : null);

            var values = await generator.GetListedValuesAsync();

            Assert.Collection(values, new Action <IEnumValue>[]
            {
                ev => { Assert.Equal(expected: "cheetah", actual: ev.Name); Assert.Equal(expected: "Fast authentication!", actual: ev.DisplayName); },
                ev => { Assert.Equal(expected: "tortoise", actual: ev.Name); Assert.Equal(expected: "Sloooow authentication...", actual: ev.DisplayName); }
            });
        }