Esempio n. 1
0
        public void DetailMapIndexPropertyTest()
        {
            int index;

            var voxel = new TextureVoxel();

            try
            {
                // ReSharper disable once RedundantAssignment
                index = voxel.DetailMapIndex;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.DetailMapIndex = 0;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            voxel.TextureMapIndex = 0;

            try
            {
                voxel.DetailMapIndex = -1;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.DetailMapIndex = 1;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            voxel.DetailMapIndex = 0;
            Assert.AreEqual(voxel.DetailMapIndex, 0);
        }
Esempio n. 2
0
        public void GetHashCodeTest()
        {
            var voxelOne = new TextureVoxel();
            // ReSharper disable once RedundantArgumentDefaultValue
            var voxelTwo = new TextureVoxel(0, 0);

            Assert.IsFalse(voxelOne.GetHashCode() == voxelTwo.GetHashCode());

            // ReSharper disable once RedundantArgumentDefaultValue
            voxelOne = new TextureVoxel(0, 0);

            Assert.IsTrue(voxelOne.GetHashCode() == voxelTwo.GetHashCode());
        }
Esempio n. 3
0
        public void EmptyPropertyTest()
        {
            var voxel = new TextureVoxel();

            voxel.Empty = true;
            Assert.AreEqual(voxel.Empty, true);

            try
            {
                voxel.Empty = false;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Esempio n. 4
0
        public void EqualsTest()
        {
            var voxelOne = new TextureVoxel();
            // ReSharper disable once RedundantArgumentDefaultValue
            var voxelTwo = new TextureVoxel(0, 0);

            Assert.IsFalse(voxelOne.Equals(voxelTwo));

            // ReSharper disable once RedundantArgumentDefaultValue
            voxelOne = new TextureVoxel(0, 0);
            Assert.IsTrue(voxelOne.Equals(voxelTwo));

            int notVoxel = 1;

            // ReSharper disable once ExpressionIsAlwaysNull
            Assert.IsFalse(voxelOne.Equals(notVoxel));

            var color = Color.black;

            Assert.IsFalse(voxelOne.Equals(color));
        }
        public void AlphaLevelPropertyTest()
        {
            float level;

            var voxel = new TextureVoxel();

            try
            {
                // ReSharper disable once RedundantAssignment
                level = voxel.AlphaLevel;
            }
            catch(InvalidOperationException)
            {
            }
            catch(Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.AlphaLevel = 0f;
            }
            catch(InvalidOperationException)
            {
            }
            catch(Exception)
            {
                Assert.Fail();
            }

            voxel.TextureMapIndex = 0;

            voxel.AlphaLevel = 0.5f;
            Assert.AreEqual(voxel.AlphaLevel, 0.5f);
        }
Esempio n. 6
0
        public void AlphaLevelPropertyTest()
        {
            float level;

            var voxel = new TextureVoxel();

            try
            {
                // ReSharper disable once RedundantAssignment
                level = voxel.AlphaLevel;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.AlphaLevel = 0f;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            voxel.TextureMapIndex = 0;

            voxel.AlphaLevel = 0.5f;
            Assert.AreEqual(voxel.AlphaLevel, 0.5f);
        }
        public void CreateTest()
        {
            TextureVoxel voxel;
            voxel = new TextureVoxel();
            Assert.IsTrue(voxel.Empty);

            try
            {
                new TextureVoxel(-1);
            }
            catch(ArgumentException)
            {
            }
            catch(Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(0, -1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(0, 1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            // ReSharper disable once RedundantArgumentDefaultValue
            voxel = new TextureVoxel(0, 0);
            Assert.IsFalse(voxel.Empty);
            Assert.AreEqual(voxel.TextureMapIndex, 0);
            Assert.AreEqual(voxel.DetailMapIndex, 0);
        }
        public void TextureMapIndexPropertyTest()
        {
            int index;

            var voxel = new TextureVoxel();

            try
            {
                // ReSharper disable once RedundantAssignment
                index = voxel.TextureMapIndex;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.TextureMapIndex = -1;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                voxel.TextureMapIndex = 1;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            voxel.TextureMapIndex = 0;
            Assert.AreEqual(voxel.TextureMapIndex, 0);
        }
        public void GetHashCodeTest()
        {
            var voxelOne = new TextureVoxel();
            // ReSharper disable once RedundantArgumentDefaultValue
            var voxelTwo = new TextureVoxel(0, 0);

            Assert.IsFalse(voxelOne.GetHashCode() == voxelTwo.GetHashCode());

            // ReSharper disable once RedundantArgumentDefaultValue
            voxelOne = new TextureVoxel(0, 0);

            Assert.IsTrue(voxelOne.GetHashCode() == voxelTwo.GetHashCode());
        }
        public void EqualsTest()
        {
            var voxelOne = new TextureVoxel();
            // ReSharper disable once RedundantArgumentDefaultValue
            var voxelTwo = new TextureVoxel(0, 0);
            Assert.IsFalse(voxelOne.Equals(voxelTwo));

            // ReSharper disable once RedundantArgumentDefaultValue
            voxelOne = new TextureVoxel(0, 0);
            Assert.IsTrue(voxelOne.Equals(voxelTwo));

            int notVoxel = 1;
            // ReSharper disable once ExpressionIsAlwaysNull
            Assert.IsFalse(voxelOne.Equals(notVoxel));

            var color = Color.black;
            Assert.IsFalse(voxelOne.Equals(color));
        }
        public void EmptyPropertyTest()
        {
            var voxel = new TextureVoxel();
            voxel.Empty = true;
            Assert.AreEqual(voxel.Empty, true);

            try
            {
                voxel.Empty = false;
            }
            catch (InvalidOperationException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Esempio n. 12
0
        public void CreateTest()
        {
            TextureVoxel voxel;

            voxel = new TextureVoxel();
            Assert.IsTrue(voxel.Empty);

            try
            {
                new TextureVoxel(-1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(0, -1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            try
            {
                new TextureVoxel(0, 1);
            }
            catch (ArgumentException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            // ReSharper disable once RedundantArgumentDefaultValue
            voxel = new TextureVoxel(0, 0);
            Assert.IsFalse(voxel.Empty);
            Assert.AreEqual(voxel.TextureMapIndex, 0);
            Assert.AreEqual(voxel.DetailMapIndex, 0);
        }