public void when_creating_product_on_disposed_store_then_throws() { var store = new ProductStore( "ProductStoreFixture.Simple.json", new JsonProductSerializer(), Mock.Of<IToolkitCatalog>()); store.Dispose(); Assert.Throws<ObjectDisposedException>(() => store.CreateProduct("foo", "bar", "baz")); }
public void when_disposing_then_raises_disposed() { var store = new ProductStore( "ProductStoreFixture.Simple.json", new JsonProductSerializer(), Mock.Of<IToolkitCatalog>()); var disposed = false; store.Disposed += (sender, args) => disposed = true; store.Dispose(); Assert.True(disposed); }