public void CreateMetadataLayer_WithWhiteSpaceLayerName_ThrowException()
        {
            var metadataLayerRepository = new Mock<IMetadataLayerRepository>();
            var factory = new MetadataLayerFactory(metadataLayerRepository.Object);

            factory.CreateMetadataLayer("  ", 1);
        }
        public void CreateMetadataLayer_WithValidParamters_MetadataLayerIsEditable()
        {
            var metadataLayerRepository = new Mock<IMetadataLayerRepository>();
            var factory = new MetadataLayerFactory(metadataLayerRepository.Object);

            var metadataLayer = factory.CreateMetadataLayer("Default", 1);

            metadataLayer.Name = "Changed";
        }
        public void CreateMetadataLayer_WithValidParamters_CreatedMetadataLayer()
        {
            var metadataLayerRepository = new Mock<IMetadataLayerRepository>();
            var factory = new MetadataLayerFactory(metadataLayerRepository.Object);

            var metadataLayer = factory.CreateMetadataLayer("Default", 1);

            Assert.IsNotNull ( metadataLayer );
            Assert.AreEqual ( "Default", metadataLayer.Name );
            Assert.AreEqual ( 1, metadataLayer.Level );
        }
        public void CreateMetadataLayer_WithValidParamters_MetadataLayerIsMadePersistent()
        {
            bool isPersistent = false;

            var metadataLayerRepository = new Mock<IMetadataLayerRepository>();
            metadataLayerRepository
                .Setup ( x => x.MakePersistent ( It.IsAny<MetadataLayer> () ) )
                .Callback ( () => isPersistent = true );

            var factory = new MetadataLayerFactory(metadataLayerRepository.Object);
            var metadataLayer = factory.CreateMetadataLayer("Default", 1);

            Assert.IsTrue ( isPersistent );
        }