Rework tests from 1-to-1 mapping into specifications (#46)

This commit is contained in:
Alexey Golub
2020-03-16 01:03:03 +02:00
committed by GitHub
parent 79e1a2e3d7
commit 57f168723b
80 changed files with 3235 additions and 2718 deletions

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace CliFx.Tests
{
public partial class ArgumentBindingSpecs
{
private enum CustomEnum
{
Value1 = 1,
Value2 = 2,
Value3 = 3
}
private class StringConstructable
{
public string Value { get; }
public StringConstructable(string value)
{
Value = value;
}
}
private class StringParseable
{
public string Value { get; }
private StringParseable(string value)
{
Value = value;
}
public static StringParseable Parse(string value) => new StringParseable(value);
}
private class StringParseableWithFormatProvider
{
public string Value { get; }
private StringParseableWithFormatProvider(string value)
{
Value = value;
}
public static StringParseableWithFormatProvider Parse(string value, IFormatProvider formatProvider) =>
new StringParseableWithFormatProvider(value + " " + formatProvider);
}
private class DummyType
{
}
public class CustomEnumerable<T> : IEnumerable<T>
{
private readonly T[] _arr = new T[0];
public IEnumerator<T> GetEnumerator() => ((IEnumerable<T>) _arr).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
}
}