public void GetEntityTextShouldReturnUtteranceSubstring(string utterance, int start, int end) { //Arrange var mockEntity = new EntityModel { Entity = _ENTITY, StartIndex = start, EndIndex = end }; //Act var actualEntityText = LuisUtil.GetEntityText(mockEntity, utterance, mockEntity.StartIndex, mockEntity.EndIndex + 1); //Assert Assert.Equal(_ENTITY, actualEntityText); }
public void GetEntityTextShouldReturnTheEntityItself() { //Arrange var mockEntity = new EntityModel { Entity = _ENTITY, StartIndex = 0, EndIndex = _ENTITY.Length }; //Act var actualEntityText = LuisUtil.GetEntityText(mockEntity, _ENTITY, mockEntity.StartIndex, mockEntity.EndIndex + 1); //Assert Assert.Equal(_ENTITY, actualEntityText); }
public void GetEntityTextShouldReturnUtteranceSubstringWithEntityTextSmallerThanTheEntity(string utterance, int start, int end) { //Arrange const string SMALL_ENTITY = "entity"; var mockEntity = new EntityModel { Entity = _ENTITY, StartIndex = start, EndIndex = end }; //Act var actualEntityText = LuisUtil.GetEntityText(mockEntity, utterance, mockEntity.StartIndex, mockEntity.EndIndex + 1); //Assert Assert.Equal(SMALL_ENTITY, actualEntityText); }
public void GetEntityTextShouldReturnUtterance() { //Arrange const string UTTERANCE = "entity"; var mockEntity = new EntityModel { Entity = _ENTITY, StartIndex = 0, EndIndex = _ENTITY.Length }; //Act var actualEntityText = LuisUtil.GetEntityText(mockEntity, UTTERANCE, mockEntity.StartIndex, mockEntity.EndIndex + 1); //Assert Assert.Equal(UTTERANCE, actualEntityText); }