예제 #1
0
        public void CountAfterClearTest(int expected)
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            SkillFactory.Clear();
            var actual = SkillFactory.Count;

            // Assert
            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void CountSkillsExistingAgainTest()
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            SkillFactory.Clear();
            var skill  = factory.GetSkill("greetings", _context.Object, _provider.Object);
            var skill2 = factory.GetSkill("greetings", _context.Object, _provider.Object);
            var count  = SkillFactory.Count;

            // Assert
            Assert.Equal(1, count);
        }
예제 #3
0
        public void ClearAfterInitSingleSkillTest(int expected)
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            SkillFactory.Clear();
            var skill = factory.GetSkill("greetings", _context.Object, _provider.Object);

            SkillFactory.Clear();
            var actual = SkillFactory.Count;

            // Assert
            Assert.Equal(expected, actual);
        }