Example #1
0
        public void Attribute_Name()
        {
            var attribute = new Attribute("test");

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual("test", attribute.Name),
                () => attribute.Name = "test2",
                () => Assert.AreEqual("test2", attribute.Name)
            );
        }
Example #2
0
        public void Attribute_Value()
        {
            var attribute = new Attribute("test");
            var val = new Value("5");

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual(Attribute.DefaultValue, attribute.Value),
                () => attribute.Value = val,
                () => Assert.AreEqual(val, attribute.Value)
            );
        }
Example #3
0
        public void Scene_RemoveAttribute()
        {
            var scene = new Scene("Test Scene");
            var attribute = new Attribute("test");
            scene.AddAttribute(attribute);
            scene.SelectedAttribute = attribute;

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual(1, scene.Attributes.Count),
                () => scene.RemoveAttributeCommand.Execute(null),
                () => Assert.AreEqual(0, scene.Attributes.Count)
            );
        }
Example #4
0
        public void Game_RemoveAttribute()
        {
            var game = new Game("Test Game");
            var attribute = new Attribute("test");
            game.AddAttribute(attribute);
            game.SelectedAttribute = attribute;

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual(1, game.Attributes.Count),
                () => game.RemoveAttributeCommand.Execute(null),
                () => Assert.AreEqual(0, game.Attributes.Count)
            );
        }
Example #5
0
        public void Entity_RemoveAttribute()
        {
            var entity = new Entity();
            var attribute = new Attribute("test");
            entity.AddAttribute(attribute);
            entity.SelectedAttribute = attribute;

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual(1, entity.Attributes.Count),
                () => entity.RemoveAttributeCommand.Execute(null),
                () => Assert.AreEqual(0, entity.Attributes.Count)
            );
        }
Example #6
0
        public void Attribute_ClearValue()
        {
            var attribute = new Attribute("test") { Value = new Value(5, true) };

            CommandHelper.TestUndoableCommand(
                () => Assert.AreEqual(5, attribute.Value.GetIntValue()),
                () => attribute.ClearValueCommand.Execute(null),
                () => Assert.AreEqual(0, attribute.Value.GetIntValue())
            );
        }