public async Task GetProviderAsync_ReturnsNonNullGenerator()
        {
            var project = ConfiguredProjectFactory.Create();

            var provider  = new LaunchTargetPropertyPageEnumProvider(project);
            var generator = await provider.GetProviderAsync(options : null);

            Assert.NotNull(generator);
        }
        public async Task TryCreateEnumValueAsync_ReturnsNull()
        {
            var project = ConfiguredProjectFactory.Create();

            var provider  = new LaunchTargetPropertyPageEnumProvider(project);
            var generator = await provider.GetProviderAsync(options : null);

            Assert.Null(await generator.TryCreateEnumValueAsync("MyTarget"));
        }
Ejemplo n.º 3
0
        public async Task TryCreateEnumValueAsync_Throws()
        {
            var project = ConfiguredProjectFactory.Create();

            var provider  = new LaunchTargetPropertyPageEnumProvider(project);
            var generator = await provider.GetProviderAsync(options : null);

            await Assert.ThrowsAsync <NotImplementedException>(() => generator.TryCreateEnumValueAsync("MyTarget"));
        }
        public async Task GetListValuesAsync_ReturnsPageNamesAndDisplayNames()
        {
            var catalogProvider = GetCatalogProviderAndData();

            var provider = new LaunchTargetPropertyPageEnumProvider(
                ConfiguredProjectFactory.Create(
                    services: ConfiguredProjectServicesFactory.Create(
                        propertyPagesCatalogProvider: catalogProvider)));
            var generator = await provider.GetProviderAsync(options : null);

            var values = await generator.GetListedValuesAsync();

            Assert.Collection(values, new Action <IEnumValue>[]
            {
                ev => { Assert.Equal(expected: "BetaCommandPageId", actual: ev.Name); Assert.Equal(expected: "Beta", actual: ev.DisplayName); },
                ev => { Assert.Equal(expected: "GammaCommandPageId", actual: ev.Name); Assert.Equal(expected: "Gamma", actual: ev.DisplayName); }
            });
        }