public void ThreeValueMatchTwo() => Union .FromDefinition <ThreeDefinition>() .Create((sbyte)10) .Value() .Match(_ => false, _ => true, _ => false) .Should() .BeTrue();
public void FourValueMatchThree() => Union .FromDefinition <FourDefinition>() .Create((ushort)10) .Value() .Match(_ => false, _ => false, _ => true, _ => false) .Should() .BeTrue();
public void EightValueMatchFour() => Union .FromDefinition <EightDefinition>() .Create((short)10) .Value() .Match(_ => false, _ => false, _ => false, _ => true, _ => false, _ => false, _ => false, _ => false) .Should() .BeTrue();
public void EightValueMatchEight() => Union .FromDefinition <EightDefinition>() .Create((long)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void SevenValueMatchSeven() => Union .FromDefinition <SevenDefinition>() .Create((ulong)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void TwoValueMatchOne() => Union .FromDefinition <TwoDefinition>() .Create((byte)10) .Value() .Match(_ => true, _ => false) .Should() .BeTrue();
public void SixValueMatchSix() => Union .FromDefinition <SixDefinition>() .Create((int)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void FiveValueMatchFive() => Union .FromDefinition <FiveDefinition>() .Create((uint)10) .Value() .Match(_ => false, _ => false, _ => false, _ => false, _ => true) .Should() .BeTrue();
public void OneValueMatchOne() => Union .FromDefinition <OneDefinition>() .Create((byte)10) .Value() .Match(_ => true) .Should() .BeTrue();
public void UnionDefinitionOneOfFourCanSerializeAndDeserialize() { var value = Union.FromDefinition <FourUnionDefinition>().Create((sbyte)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
public void UnionDefinitionThreeOfThreeCanSerializeAndDeserialize() { var value = Union.FromDefinition <ThreeUnionDefinition>().Create((short)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
public void UnionDefinitionEightOfEightCanSerializeAndDeserialize() { var value = Union.FromDefinition <EightUnionDefinition>().Create((ulong)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
public void UnionDefinitionSixOfSevenCanSerializeAndDeserialize() { var value = Union.FromDefinition <SevenUnionDefinition>().Create((uint)64); SerializationUtility .CloneViaSerialization(value) .Value() .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }) .Should() .BeEquivalentTo(value); }
private IEnumerable <Union <OneDefinition> > CreateDefinitionArray() => new[] { Union.FromDefinition <OneDefinition>().Create((sbyte)1), Union.FromDefinition <OneDefinition>().Create((byte)1), };