예제 #1
0
        public string CreateFixture(string keyOrTitle)
        {
            var fixture = FixtureModel.BuildFromKeyOrTitle(keyOrTitle);
            var file    = FileFor(fixture.key);

            if (File.Exists(file))
            {
                ConsoleWriter.Write(ConsoleColor.White, $"Fixture file '{file}' already exists");
            }
            else
            {
                _watcher.Latch(() =>
                {
                    FixtureWriter.Write(fixture, file);
                });

                _overrides.Models[fixture.key] = fixture;

                sendUpdatesToClient();

                ConsoleWriter.Write(ConsoleColor.Green, $"Successfully created a new Fixture {fixture.key}: {fixture.title}");
            }

            return(file);
        }
        public void derive_the_title_for_a_complex_key()
        {
            var fixture = FixtureModel.BuildFromKeyOrTitle("SomethingElse");

            fixture.key.ShouldBe("SomethingElse");
            fixture.title.ShouldBe("Something Else");
        }
        public void derive_the_key_from_a_title_3()
        {
            var fixture = FixtureModel.BuildFromKeyOrTitle("Going to the store - Walmart");

            fixture.title.ShouldBe("Going to the store - Walmart");
            fixture.key.ShouldBe("GoingToTheStoreWalmart");
        }
        public void create_a_fixture_from_a_key()
        {
            var fixture = FixtureModel.BuildFromKeyOrTitle("Something");

            fixture.key.ShouldBe("Something");
            fixture.title.ShouldBe("Something");
        }