public void DisposeTest() { ResX_AggregatorPackage package = new ResX_AggregatorPackage(); EditorFactory editorFactory = new EditorFactory(package); editorFactory.Dispose(); }
public void DisposeDisposableMembersTest() { ResX_AggregatorPackage package = new ResX_AggregatorPackage(); EditorFactory editorFactory = new EditorFactory(package); OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); editorFactory.SetSite(serviceProvider); object service = editorFactory.GetService(typeof(IProfferService)); Assert.IsNotNull(service); editorFactory.Dispose(); //service provider contains no services after this call service = editorFactory.GetService(typeof(IProfferService)); Assert.IsNull(service, "serviceprovider has not beed disposed as expected"); }