public void GetImageTest()
        {
            using (var tempDirectory = new TempDirectory(true))
            {
                var manager = new ResultImageManager2();
                manager.DirectoryName = tempDirectory.Name;

                tempDirectory.AddFile(@"A\a0.bmp", new Bitmap(10, 10));

                {
                    var image = manager.GetImage("A");
                    Assert.NotNull(image);
                    Assert.AreEqual(tempDirectory.FullPath(@"A\a0.bmp"), image.Tag);
                }

                tempDirectory.AddFile(@"A\a1.bmp", new Bitmap(11, 10));
                tempDirectory.AddFile(@"A\a2.bmp", new Bitmap(12, 10));

                manager.PrepareForImages();
                CollectionAssert.AreEquivalent(new []
                {
                    tempDirectory.FullPath(@"A\a0.bmp"),
                    tempDirectory.FullPath(@"A\a1.bmp"),
                    tempDirectory.FullPath(@"A\a2.bmp"),
                }, manager.Files);

                manager.PrepareForImages();
                tempDirectory.DeleteFile(@"A\a0.bmp");
                CollectionAssert.AreEquivalent(new []
                {
                    tempDirectory.FullPath(@"A\a1.bmp"),
                    tempDirectory.FullPath(@"A\a2.bmp"),
                }, new [] { manager.GetImage("A").Tag, manager.GetImage("A").Tag, }.Cast<string>());

                manager.PrepareForImages();
                tempDirectory.DeleteFile(@"A\a1.bmp");
                CollectionAssert.AreEquivalent(new []
                {
                    tempDirectory.FullPath(@"A\a2.bmp"),
                    tempDirectory.FullPath(@"A\a2.bmp"),
                }, new [] { manager.GetImage("A").Tag, manager.GetImage("A").Tag, }.Cast<string>());

                manager.PrepareForImages();
                tempDirectory.DeleteFile(@"A\a2.bmp");
                Assert.Null(manager.GetImage("A"));
                Assert.Null(manager.GetImage("A"));
            }
        }
        public void Test1()
        {
            using (var tempDirectory = new TempDirectory(true))
            {
                {
                    var manager = new ResultImageManager2();
                    manager.DirectoryName = tempDirectory.Name;

                    tempDirectory.AddFile(@"A\file0.png", "");
                    tempDirectory.AddFile(@"B\file0.bmp", "");
                    tempDirectory.AddFile(@"D\file0.txt", "");
                    manager.PrepareForImages();
                    CollectionAssert.AreEquivalent(new []
                    {
                        tempDirectory.GetFullPath(@"A\file0.png"),
                        tempDirectory.GetFullPath(@"B\file0.bmp"),

                    }, manager.Files);

                    Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A"));
                    CollectionAssert.AreEquivalent(new []
                    {
                        tempDirectory.GetFullPath(@"B\file0.bmp"),

                    }, manager.Files);

                    Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B"));

                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("D"));
                    Assert.Null(manager.GetFile("D"));
                    Assert.Null(manager.GetFile("D"));

                    tempDirectory.AddFile(@"file3.jpg", "");
            /*					Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D"));
                    Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D"));
                    */
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("C"));
                    Assert.Null(manager.GetFile("D"));
                    Assert.Null(manager.GetFile("D"));
                }
                {
                    var manager = new ResultImageManager2();
                    manager.DirectoryName = tempDirectory.Name;

                    tempDirectory.AddFile(@"A\file1.png", "");
                    CollectionAssert.AreEquivalent(new []
                    {
                        tempDirectory.GetFullPath(@"A\file0.png"),
                        tempDirectory.GetFullPath(@"A\file0.png"),
                        tempDirectory.GetFullPath(@"A\file1.png"),
                        tempDirectory.GetFullPath(@"A\file1.png"),

                    }, new []
                    {
                        manager.GetFile("A"),
                        manager.GetFile("A"),
                        manager.GetFile("A"),
                        manager.GetFile("A"),
                    });
                }
            }
        }