|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Matching.Expressions;
namespace Matching.Tests
{
[TestClass]
public class OrMatchingExpressionTests
{
[TestMethod]
public void OrMatchingExpressionTest()
{
var subject = new OrMatchingExpression();
subject.Add(new int[] { 12, 22, 65 });
subject.Add(new int[] { 05, 17, 22, 65, 67 });
subject.Add(new int[] { 17, 22, 99 });
var result = subject.ToArray();
for (int i = 0; i < result.Length; i++)
Console.WriteLine(result[i]);
CollectionAssert.AreEqual(result.ToList(), new List<int>(new int[] { 05, 12, 17, 22, 65, 67, 99 }));
}
[TestMethod]
public void OrMatchingExpressionTest2()
{
var subject = new OrMatchingExpression();
subject.Add(new int[] { });
subject.Add(new int[] { 05 });
var result = subject.ToArray();
for (int i = 0; i < result.Length; i++)
Console.WriteLine(result[i]);
CollectionAssert.AreEqual(result.ToList(), new List<int>(new int[] { 05 }));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.