示例#1
0
        public void Instantiate()
        {
            DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>();

            Assert.NotNull(element);
            Assert.NotNull(element.Text);
        }
示例#2
0
        public void NoCharacter()
        {
            NpcChatProject project = new NpcChatProject();

            DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>(project);

            Assert.IsFalse(project.ProjectCharacters.HasCharacter(element.CharacterId));
            Assert.AreEqual("<???>", element.Text, "missing character should return a fallback value");
        }
示例#3
0
        public void IdChangedCallback()
        {
            DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>();

            bool changed = false;

            element.PropertyChanged += (s, a) => { changed = true; };

            element.CharacterId = 12;
            Assert.IsTrue(changed, "Failed to trigger PropertyChanged callback");
        }
示例#4
0
        public void NameTrait()
        {
            NpcChatProject project = new NpcChatProject();

            if (project.ProjectCharacters.RegisterNewCharacter(out int id, "Tim"))
            {
                DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>(project);
                element.CharacterTrait = "Name";

                Assert.IsFalse(project.ProjectCharacters.HasCharacter(element.CharacterId));
                Assert.AreNotEqual("Tim", element.Text, "Character name doesn't match");

                element.CharacterId = id;
                Assert.IsTrue(project.ProjectCharacters.HasCharacter(element.CharacterId));
                Assert.AreEqual("Tim", element.Text, "Character name doesn't match");
            }
            else
            {
                Assert.Fail("Failed to create new character");
            }
        }
示例#5
0
        public void NoProject()
        {
            DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>();

            Assert.AreEqual("<???>", element.Text, "missing project should return a fallback value");
        }
示例#6
0
        public void HasElementName()
        {
            DialogCharacterTrait element = DialogTypeStore.Instance.CreateEntity <DialogCharacterTrait>();

            Assert.NotNull(element.ElementName);
        }