コード例 #1
0
        public void DisposeTest()
        {
            var manager = new HybridResourceManager("KGySoft.CoreLibraries.Resources.TestCompiledResource", GetType().Assembly, resXBaseName);

            manager.Dispose();
            Throws <ObjectDisposedException>(() => manager.ReleaseAllResources());
            Throws <ObjectDisposedException>(() => manager.GetString("TestString"));
            manager.Dispose(); // this will not throw anything

            manager        = new HybridResourceManager("KGySoft.CoreLibraries.Resources.TestCompiledResource", GetType().Assembly, resXBaseName);
            manager.Source = ResourceManagerSources.CompiledOnly;
            manager.Dispose();
            Throws <ObjectDisposedException>(() => manager.ReleaseAllResources());
            Throws <ObjectDisposedException>(() => manager.GetString("TestString"));
            manager.Dispose(); // this will not throw anything
        }