Ejemplo n.º 1
0
 public PgnManager(IReadPgnFiles reader, IWritePgnFiles writer, IGameRepository repo, ILogger logger)
 {
     _reader = reader;
     _writer = writer;
     _repo   = repo;
     _logger = logger;
 }
Ejemplo n.º 2
0
        public void WrongResultNotationTest(IReadPgnFiles reader, IWritePgnFiles writer)
        {
            "GIVEN a single file with wrong result notation".x(() =>
            {
                reader = new PgnReader(TestFixture.FolderWithOneFileWrongNotation);
                writer = new PgnWriter(TestFixture.PathResultedPgn);
            });

            "WHEN the file is read".x(() =>
            {
                var manager = new PgnManager(reader, writer, TestFixture.FakeRepo, TestFixture.FakeLogger);
                manager.ExecuteCheckingForDuplicates(g => { });
            });

            "THEN the new file created contains two games".x(() =>
            {
                TestFixture.ContentOfResultedPgn.ShouldBe(TestFixture.ContentOfWrongResultGames);
            });
        }
Ejemplo n.º 3
0
        public void OneGameTest(IReadPgnFiles reader, IWritePgnFiles writer)
        {
            "GIVEN a single file with one game".x(() =>
            {
                reader = new PgnReader(TestFixture.FolderWithOneFileOneGame);
                writer = new PgnWriter(TestFixture.PathResultedPgn);
            });

            "WHEN the file is read".x(() =>
            {
                var manager = new PgnManager(reader, writer, TestFixture.FakeRepo, TestFixture.FakeLogger);
                manager.ExecuteCheckingForDuplicates(g => { });
            });

            "THEN the new file created contains one game".x(() =>
            {
                TestFixture.ContentOfResultedPgn.ShouldBe(TestFixture.ContentOfExpectedOneGame);
            });
        }
Ejemplo n.º 4
0
        public void TwoNestedFilesTest(IReadPgnFiles reader, IWritePgnFiles writer)
        {
            "GIVEN a folder with two nested files where each file contains one game".x(() =>
            {
                reader = new PgnReader(TestFixture.FolderWithNestedFiles);
                writer = new PgnWriter(TestFixture.PathResultedPgn);
            });

            "WHEN the files are read".x(() =>
            {
                var manager = new PgnManager(reader, writer, TestFixture.FakeRepo, TestFixture.FakeLogger);
                manager.ExecuteCheckingForDuplicates(g => { });
            });

            "THEN the new file created contains two games".x(() =>
            {
                TestFixture.ContentOfResultedPgn.ShouldBe(TestFixture.ContentOfExpectedTwoGames);
            });
        }