コード例 #1
0
        public void NewLayer_AddingANewLayer()
        {
            // The layer Dictionary
            var layerDictionary = new LayerDictionary();

            // The inital count should be 0
            Assert.IsTrue(layerDictionary.Count == 0);
            // Adding one layer
            layerDictionary.NewLayer("HelloWorld");
            // Now the count should be 1
            Assert.IsTrue(layerDictionary.Count == 1);
        }
コード例 #2
0
        public void ContainsLayer_ShouldContainTheLayerHelloWorld()
        {
            // The layer Dictionary
            var layerDictionary = new LayerDictionary();

            // The inital count should be 0
            Assert.IsTrue(layerDictionary.Count == 0);
            // Adding one layer
            layerDictionary.NewLayer("HelloWorld");
            // Now the count should be 1
            Assert.IsTrue(layerDictionary.Count == 1);
            // The layerDic should contain the layer HelloWorld
            Assert.IsTrue(layerDictionary.ContainsLayer("HelloWorld"));
            Assert.IsFalse(layerDictionary.ContainsLayer("ShouldNotContain"));
        }
コード例 #3
0
        public void GetLayer_ShouldGetHelloWorldLayer()
        {
            // The layer Dictionary
            var layerDictionary = new LayerDictionary();

            // The inital count should be 0
            Assert.IsTrue(layerDictionary.Count == 0);

            // Adding one layer
            layerDictionary.NewLayer("HelloWorld");

            // Now the count should be 1
            Assert.IsTrue(layerDictionary.Count == 1);

            // Get the layer HelloWorld
            var testGetLayer = layerDictionary.GetLayer("HelloWorld");

            Assert.IsTrue(testGetLayer.Name == "HelloWorld");
        }