Esempio n. 1
0
        public void SelectOption_Should_ContaintNextNode()
        {
            // Arrange
            DialogNode <TestContent> realNextNode      = null;
            DialogNode <TestContent> currentDialogNode = DialogNode <TestContent> .CreateNew(content : new TestContent(), dialogOptions : new List <DialogOptionNext <TestContent> > {
            });

            DialogNode <TestContent> nextNode = DialogNode <TestContent> .CreateNew(content : new TestContent(), dialogOptions : new List <DialogOptionNext <TestContent> > {
            });

            DialogOptionNext <TestContent> optionToSelect = new DialogOptionNext <TestContent>(new TestContent(), nextNode);

            void FuncToFire(object sender, DialogNode <TestContent> e)
            {
                realNextNode = e;
            }

            optionToSelect.SelectEvent += FuncToFire;


            // Act
            optionToSelect.Select();

            // Assert
            Assert.Equal(nextNode, realNextNode);
        }
Esempio n. 2
0
        public void AllSet_Should_BeSet()
        {
            // Arrange
            TestContent content = new TestContent();
            DialogNode <TestContent> nextDialogNode = DialogNode <TestContent> .CreateNew(content : new TestContent(), dialogOptions : new List <DialogOptionNext <TestContent> > {
            });

            // Act
            DialogOptionNext <TestContent> dialogOption = new DialogOptionNext <TestContent>(content: content, nextNode: nextDialogNode);

            // Assert
            Assert.Equal(content, dialogOption.Content);
            Assert.Equal(nextDialogNode, dialogOption.NextNode);
        }
Esempio n. 3
0
        public void SelectOption_Should_RaiseEvent()
        {
            // Arrange
            bool isFired = false;
            DialogNode <TestContent> currentDialogNode = DialogNode <TestContent> .CreateNew(content : new TestContent(), dialogOptions : new List <DialogOptionNext <TestContent> > {
            });

            DialogOptionNext <TestContent> optionToSelect = new DialogOptionNext <TestContent>(new TestContent(), DialogNode <TestContent> .CreateNew(content: new TestContent(), dialogOptions: new List <DialogOptionNext <TestContent> > {
            }));

            void FuncToFire(object sender, DialogNode <TestContent> e)
            {
                isFired = true;
            }

            optionToSelect.SelectEvent += FuncToFire;


            // Act
            optionToSelect.Select();

            // Assert
            Assert.True(isFired);
        }