Exemplo n.º 1
0
        public void MaterialDictionary_getNonExistantMaterial_DoesntExist()
        {
            var matDict = new MaterialDictionary();
            var steel   = new Material(MaterialType.Metal, "steel", .25, 100, 79, 70);
            var alum    = new Material(MaterialType.Metal, "aluminum", .25, 100, 79, 70);

            matDict.AddMaterial(steel);
            matDict.AddMaterial(alum);
            bool exists = matDict.MaterialExists("plastic");

            Assert.IsFalse(exists);
        }
Exemplo n.º 2
0
        public void MaterialDictionary_getMaterial_matOK()
        {
            var matDict = new MaterialDictionary();
            var mat     = new Material(MaterialType.Metal, "steel", .25, 100, 79, 70);

            matDict.AddMaterial(mat);
            var  matOut = matDict.GetMaterial("steel");
            bool exists = matDict.MaterialExists("steel");

            Assert.IsTrue(exists);
            Assert.AreEqual("STEEL", matOut.Name, "name");
            Assert.AreEqual(mat.MillMachinability, matOut.MillMachinability);
        }