Пример #1
0
        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"));
        }
Пример #2
0
        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);
        }