public void ConstructEmptyExpression() { //Arrange var logger = new Mock <ILog>(); logger.Setup(log => log.Error(It.IsAny <string>())); ITokenDiscriminator discriminator = new StandartTokenDiscriminator(logger.Object); //Act var tokens = discriminator.ConstructTokens(null); //Assert logger.Verify(); Assert.IsNull(tokens); }
public void ConstructTokensTest(string expression, int countToken) { //Arrange var logger = new Mock <ILog>(); logger.Setup(log => log.Error(It.IsAny <string>())); ITokenDiscriminator discriminator = new StandartTokenDiscriminator(logger.Object); //Act var tokens = discriminator.ConstructTokens(expression); //Assert Assert.AreEqual(countToken, tokens.Count); Assert.AreSame(tokens, discriminator.Tokens); }