private IEnumerable <Union <sbyte, byte, short> > CreateTypesThreeArray() => new[] { Union.FromTypes <sbyte, byte, short>().Create((sbyte)1), Union.FromTypes <sbyte, byte, short>().Create((byte)1), Union.FromTypes <sbyte, byte, short>().Create((short)1), };
public void FourValueMatchFour() => Union .FromTypes <byte, sbyte, ushort, short>() .Create((short)10) .Value() .Match(_ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void EightValueMatchEight() => Union .FromTypes <byte, sbyte, ushort, short, uint, int, ulong, long>() .Create((long)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void SevenValueMatchSix() => Union .FromTypes <byte, sbyte, ushort, short, uint, int, ulong>() .Create((int)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => false, _ => true, _ => false) .Should() .BeTrue();
public void TwoValueMatchTwo() => Union .FromTypes <byte, sbyte>() .Create((sbyte)10) .Value() .Match(_ => false, _ => true) .Should() .BeTrue();
public void ThreeValueMatchThree() => Union .FromTypes <byte, sbyte, ushort>() .Create((ushort)10) .Value() .Match(_ => false, _ => false, _ => true) .Should() .BeTrue();
public void SixValueMatchFive() => Union .FromTypes <byte, sbyte, ushort, short, uint, int>() .Create((uint)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => true, _ => false) .Should() .BeTrue();
public void FiveValueMatchTwo() => Union .FromTypes <byte, sbyte, ushort, short, uint>() .Create((sbyte)10) .Value() .Match(_ => false, _ => true, _ => false, _ => false, _ => false) .Should() .BeTrue();
private IEnumerable <Union <sbyte, byte, short, ushort, int> > CreateTypesFiveArray() => new[] { Union.FromTypes <sbyte, byte, short, ushort, int>().Create((sbyte)1), Union.FromTypes <sbyte, byte, short, ushort, int>().Create((byte)1), Union.FromTypes <sbyte, byte, short, ushort, int>().Create((short)1), Union.FromTypes <sbyte, byte, short, ushort, int>().Create((ushort)1), Union.FromTypes <sbyte, byte, short, ushort, int>().Create(1), };
private IEnumerable <Union <sbyte, byte, short, ushort, int, uint, long> > CreateTypesSevenArray() => new[] { Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((sbyte)1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((byte)1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((short)1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((ushort)1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create(1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((uint)1), Union.FromTypes <sbyte, byte, short, ushort, int, uint, long>().Create((long)1), };
public void AdhocUnionTwoOfFourCanSerializeAndDeserialize() { var value = Union.FromTypes<sbyte, byte, short, ushort>().Create((byte)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
public void AdhocUnionEightOfEightCanSerializeAndDeserialize() { var value = Union.FromTypes<sbyte, byte, short, ushort, int, uint, long, ulong>().Create((ulong)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
public void EightValueDoEight() { bool result = false; Union .FromTypes <byte, sbyte, ushort, short, uint, int, ulong, long>() .Create((long)10) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => result = true); result.Should().BeTrue(); }
public void SevenValueDoSix() { bool result = false; Union .FromTypes <byte, sbyte, ushort, short, uint, int, ulong>() .Create((int)10) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => result = true, _ => { }); result.Should().BeTrue(); }
public void SixValueDoFour() { bool result = false; Union .FromTypes <byte, sbyte, ushort, short, uint, int>() .Create((short)10) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => result = true, _ => { }, _ => { }); result.Should().BeTrue(); }
public void FiveValueDoFive() { bool result = false; Union .FromTypes <byte, sbyte, ushort, short, uint>() .Create((uint)10) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => result = true); result.Should().BeTrue(); }
public void FourValueDoThree() { bool result = false; Union .FromTypes <byte, sbyte, ushort, short>() .Create((ushort)10) .Value() .Do(_ => { }, _ => { }, _ => result = true, _ => { }); result.Should().BeTrue(); }
public void TwoValueDoTwo() { bool result = false; Union .FromTypes <byte, sbyte>() .Create((sbyte)10) .Value() .Do(_ => { }, _ => result = true); result.Should().BeTrue(); }
private IEnumerable <Union <sbyte, byte> > CreateTypesTwoArray() => new[] { Union.FromTypes <sbyte, byte>().Create((sbyte)1), Union.FromTypes <sbyte, byte>().Create((byte)1), };
public static ParsedMethodBody Create(MethodInfo method, Instruction[] instructions) => new ParsedMethodBody(Union.FromTypes <ConstructorInfo, MethodInfo>().Create(method), instructions);