private void ArrangeByDefault() { var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); Retorts.ReadOnlyFile = true; }
public void GetInstanceTest() { // Arrange var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); // Act // Assert Assert.NotNull(retorts); }
public void ClearEmptyTest() { // Arrange var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); Retorts.ReadOnlyFile = true; // Act retorts.Clear(); // Assert Assert.True(retorts.IsEmpty()); }
public void ClearCountAfterInitTest() { // Arrange const uint expected = 0; var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); Retorts.ReadOnlyFile = true; // Act var actual = retorts.Count; // Assert Assert.Equal(expected, actual); }
public void ProcessTest(string request, string expected) { // Arrange var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var skills = SkillFactory.GetInstance(_context.Object, _provider.Object); Retorts retorts = Retorts.Instance(_context.Object, _provider.Object); // TODO add call to load retorts from file var resultOfAdd = retorts.Add("hi", "hello"); // Act var actual = retorts.Process(request); bool removal = retorts.Remove("hi"); // Assert Assert.Equal(expected, actual); }
public void RemoveTest(string given_key, string given_value, bool expected) { // Arrange var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); Retorts.ReadOnlyFile = true; // Act retorts.Clear(); var added = retorts.Add(given_key, given_value); var removal = retorts.Remove(given_key); // Assert Assert.Equal(expected, removal); }
public void ClearCountAfterLoadTest() { // Arrange var brainState = new BrainState(); _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object)) .Returns(brainState); var retorts = Retorts.Instance(_context.Object, _provider.Object); Retorts.ReadOnlyFile = true; // Act retorts.Clear(); retorts.Load(); var actual = retorts.Count; // Assert Assert.True(actual > 0); }