Exemplo n.º 1
0
        public void DestroyMetadataRoot_WithMetadataNode_ThrowException()
        {
            var metadataRepository = new Mock<IMetadataRepository>();
            var factory = new MetadataFactory(metadataRepository.Object);
            var metadataNode = new MetadataNode("MyResource");

            factory.DestroyMetadataRoot(metadataNode);
        }
Exemplo n.º 2
0
        public void DestroyMetadataRoot_WithValidMetadataRoot_MetadataRootIsTransient()
        {
            bool isTransient = false;

            var metadataRepository = new Mock<IMetadataRepository>();
            metadataRepository
                .Setup(a => a.MakeTransient(It.IsAny<MetadataRoot>()))
                .Callback(() => isTransient = true);
            var factory = new MetadataFactory(metadataRepository.Object);
            var metadataRoot = new MetadataRoot("MyResource", 1);

            factory.DestroyMetadataRoot(metadataRoot);

            Assert.IsTrue(isTransient);
        }
Exemplo n.º 3
0
        public void DestroyMetadataRoot_WithNullMetadataRoot_ThrowException()
        {
            var metadataRepository = new Mock<IMetadataRepository>();
            var factory = new MetadataFactory(metadataRepository.Object);

            factory.DestroyMetadataRoot(null);
        }