public void FieldSourceWithNoStringsHasNoTokens() { IEnumerable<string> values = null; // TODO: Initialize to an appropriate value FieldSource<string> target = new FieldSource<string>(values); // TODO: Initialize to an appropriate value var result = target.Tokens; Verify.That(result).IsNotNull() .IsACollectionThat() .IsAnInstanceOfType(typeof(IEnumerable<Token>)) .Count().IsEqualTo(0); }
public void FieldSourceWithSingleStringHasOneToken() { string value = "Test"; // TODO: Initialize to an appropriate value FieldSource<string> target = new FieldSource<string>(value); var tokens = target.Tokens.ToList(); Verify.That(tokens).IsACollectionThat().Count().IsEqualTo(1); Token token = tokens.First(); Verify.That(token.Value).IsAStringThat().IsEqualTo(value); Verify.That(token.Offset).IsEqualTo(0); }
public void FieldSourceWithThreeStringsHasThreeTokens() { string[] values = new string[]{"One", "Two", "Three"}; // TODO: Initialize to an appropriate value FieldSource<string> target = new FieldSource<string>(values); var tokens = target.Tokens.ToList(); Verify.That(tokens).IsACollectionThat().Count().IsEqualTo(3); int i = 0; foreach (var token in tokens) { Verify.That(token.Value).IsAStringThat().IsEqualTo(values[i]); Verify.That(token.Offset).IsEqualTo(0); i++; } }