Ejemplo n.º 1
0
        public void DefaultProjectPath_IsTheProjectPath()
        {
            var provider = new LaunchProfileProjectPropertiesProvider(
                CreateDefaultTestProject(),
                ILaunchSettingsProviderFactory.Create(),
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var defaultProjectPath = provider.DefaultProjectPath;

            Assert.Equal(expected: DefaultTestProjectPath, actual: defaultProjectPath);
        }
Ejemplo n.º 2
0
        public void WhenRetrievingItemProperties_NullIsReturnedIfTheItemIsNull()
        {
            var project  = UnconfiguredProjectFactory.Create();
            var provider = new LaunchProfileProjectPropertiesProvider(
                project,
                ILaunchSettingsProviderFactory.Create(),
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var itemProperties = provider.GetItemProperties(LaunchProfileProjectItemProvider.ItemType, item: null);

            Assert.Null(itemProperties);
        }
Ejemplo n.º 3
0
        public void WhenRetrievingProjectLevelProperties_NullIsReturned()
        {
            var project  = UnconfiguredProjectFactory.Create();
            var provider = new LaunchProfileProjectPropertiesProvider(
                project,
                ILaunchSettingsProviderFactory.Create(),
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var commonProperties = provider.GetCommonProperties();

            Assert.Null(commonProperties);
        }
Ejemplo n.º 4
0
        public void WhenRetrievingItemProperties_PropertiesAreReturnedIfTheItemTypeIsNull()
        {
            var provider = new LaunchProfileProjectPropertiesProvider(
                UnconfiguredProjectFactory.Create(),
                CreateDefaultTestLaunchSettings(),
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var properties = provider.GetItemProperties(
                itemType: null,
                item: "Profile1");

            Assert.NotNull(properties);
        }
Ejemplo n.º 5
0
        public void WhenRetrievingItemProperties_NullIsReturnedWhenTheFilePathIsNotTheProjectPath()
        {
            var provider = new LaunchProfileProjectPropertiesProvider(
                CreateDefaultTestProject(),
                CreateDefaultTestLaunchSettings(),
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var properties = provider.GetProperties(
                file: @"C:\sigma\lambda\other.csproj",
                itemType: LaunchProfileProjectItemProvider.ItemType,
                item: "Profile1");

            Assert.Null(properties);
        }
Ejemplo n.º 6
0
        public void WhenRetrievingItemProperties_NullIsReturnedIfTheItemTypeDoesNotMatch()
        {
            var profile1 = new WritableLaunchProfile {
                Name = "Profile1"
            };
            var profile2 = new WritableLaunchProfile {
                Name = "Profile2"
            };
            var launchSettingsProvider = ILaunchSettingsProviderFactory.Create(
                launchProfiles: new[] { profile1.ToLaunchProfile(), profile2.ToLaunchProfile() });

            var provider = new LaunchProfileProjectPropertiesProvider(
                UnconfiguredProjectFactory.Create(),
                launchSettingsProvider,
                EmptyLaunchProfileExtensionValueProviders,
                EmptyGlobalSettingExtensionValueProviders);

            var properties = provider.GetItemProperties(
                itemType: "RandomItemType",
                item: "Profile1");

            Assert.Null(properties);
        }