// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. using System.Collections; using System.Collections.Generic; namespace Microsoft.TestCommon { /// /// Helper class for generating test data for XUnit's -based tests. /// Should be used in combination with . /// /// First parameter type public class TheoryDataSet : TheoryDataSet { public void Add(TParam p) { AddItem(p); } } /// /// Helper class for generating test data for XUnit's -based tests. /// Should be used in combination with . /// /// First parameter type /// Second parameter type public class TheoryDataSet : TheoryDataSet { public void Add(TParam1 p1, TParam2 p2) { AddItem(p1, p2); } } /// /// Helper class for generating test data for XUnit's -based tests. /// Should be used in combination with . /// /// First parameter type /// Second parameter type /// Third parameter type public class TheoryDataSet : TheoryDataSet { public void Add(TParam1 p1, TParam2 p2, TParam3 p3) { AddItem(p1, p2, p3); } } /// /// Helper class for generating test data for XUnit's -based tests. /// Should be used in combination with . /// /// First parameter type /// Second parameter type /// Third parameter type /// Fourth parameter type public class TheoryDataSet : TheoryDataSet { public void Add(TParam1 p1, TParam2 p2, TParam3 p3, TParam4 p4) { AddItem(p1, p2, p3, p4); } } /// /// Base class for TheoryDataSet classes. /// public abstract class TheoryDataSet : IEnumerable { private readonly List data = new List(); protected void AddItem(params object[] values) { data.Add(values); } public IEnumerator GetEnumerator() { return data.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }