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)); }
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)); }