예제 #1
0
        public void AddResources_AddDuplicateResources_ShouldThrowInvalidOperation()
        {
            var resourceManager = new ResourceManager();
              var resources = new[]
                      {
                          new FileInfo ("c:/this/is/a/test"),
                          (FileSystemInfo) new DirectoryInfo ("c:/this/is/a/test/dir"),
                          new FileInfo ("c:/this/is/another/test"),
                          new FileInfo ("c:/this/is/yet/another/test"),
                      };

              var handles = resourceManager.AddResources (resources);
              var count = resourceManager.ResourceCount;

              Assert.That (
              resourceManager.AddResources (resources), Is.EquivalentTo (handles));

              Assert.That (count, Is.EqualTo (resourceManager.ResourceCount));
        }
예제 #2
0
 public void AddResources_AddManyResources_ShouldSucceed()
 {
     var resources = new[]
               {
                   new FileInfo ("c:/this/is/a/test"),
                   (FileSystemInfo) new DirectoryInfo ("c:/this/is/a/test/dir"),
                   new FileInfo ("c:/this/is/another/test"),
                   new FileInfo ("c:/this/is/yet/another/test"),
               };
       var resourceManager = new ResourceManager();
       Assert.That (() => resourceManager.AddResources (resources), Is.InstanceOf<ResourceHandle[]>());
       Assert.That (resourceManager.ResourceCount, Is.EqualTo (resources.Length));
 }