Exemplo n.º 1
0
        public void find_settings_for_a_specific_app_settings_file_that_exists()
        {
            var input = new KayakInput {
                Location = aSpecificLocation
            };

            var settings = KayakCommand.FindSettings(input);

            settings.ApplicationSourceName.ShouldEqual(theOriginalSettings.ApplicationSourceName);
            settings.Name.ShouldEqual(theOriginalSettings.Name);
        }
Exemplo n.º 2
0
        public void location_is_app_name()
        {
            var input = new KayakInput
            {
                Location = theOriginalSettings.Name
            };

            var settings = KayakCommand.FindSettings(input);

            settings.ApplicationSourceName.ShouldEqual(theOriginalSettings.ApplicationSourceName);
            settings.Name.ShouldEqual(theOriginalSettings.Name);
        }
Exemplo n.º 3
0
        public void find_settings_for_a_folder_if_there_is_only_one_settings_file()
        {
            var input = new KayakInput
            {
                Location = theOriginalSettings.ParentFolder
            };

            var settings = KayakCommand.FindSettings(input);

            settings.ApplicationSourceName.ShouldEqual(theOriginalSettings.ApplicationSourceName);
            settings.Name.ShouldEqual(theOriginalSettings.Name);
        }
Exemplo n.º 4
0
        public void location_is_null_try_to_use_the_current_directory()
        {
            theFileSystem.FindFiles(".".ToFullPath(), ApplicationSettings.FileSearch())
            .Each(x => theFileSystem.DeleteFile(x));

            var settings = KayakCommand.FindSettings(new KayakInput {
                Location = null
            });

            settings.PhysicalPath.ShouldEqual(".".ToFullPath());
            settings.ParentFolder.ShouldEqual(".".ToFullPath());
        }
Exemplo n.º 5
0
        public void no_application_files_exist_so_try_settings_with_just_the_physical_path()
        {
            theFileSystem.DeleteFile(theOriginalSettings.GetFileName());

            var input = new KayakInput
            {
                Location = theOriginalSettings.ParentFolder
            };

            var settings = KayakCommand.FindSettings(input);

            settings.ApplicationSourceName.ShouldBeNull();
            settings.Name.ShouldBeNull();
            settings.PhysicalPath.ShouldEqual(input.Location);
            settings.ParentFolder.ShouldEqual(input.Location);
        }
Exemplo n.º 6
0
        public void undeterministic_application_with_a_directory_and_multiple_settings()
        {
            var additionalSettings = ApplicationSettings.For <KayakApplication>();

            additionalSettings.ParentFolder = "fake-app".ToFullPath();
            additionalSettings.Name         = "SomethingElse";

            additionalSettings.Write();

            var input = new KayakInput
            {
                Location = theOriginalSettings.ParentFolder
            };

            KayakCommand.FindSettings(input).ShouldBeNull();
        }