public void GetRnd_ArgAreIncostistent_ReturnsNull( BaseFunnyType returnType, BaseFunnyType firstArg, BaseFunnyType secondArg) { var rpt = new GetRandomElementFuncDefinition(); var function = rpt.CreateConcreteOrNull( FunnyType.PrimitiveOf(returnType), FunnyType.PrimitiveOf(firstArg), FunnyType.PrimitiveOf(secondArg)); Assert.IsNull(function); }
public void GetRnd_RealInt_Real_GenericEqualsReal() { var rpt = new GetRandomElementFuncDefinition(); var function = rpt.CreateConcreteOrNull( FunnyType.Real, FunnyType.Int32, FunnyType.Int32); Assert.IsNotNull(function); Assert.Multiple(() => { Assert.AreEqual(FunnyType.Real, function.ReturnType); CollectionAssert.AreEquivalent(new[] { FunnyType.Real, FunnyType.Real }, function.ArgTypes); }); }
public void GetRnd_GenericEqualsOutputType( BaseFunnyType returnType, BaseFunnyType firstArg, BaseFunnyType secondArg) { var rpt = new GetRandomElementFuncDefinition(); var function = rpt.CreateConcreteOrNull( FunnyType.PrimitiveOf(returnType), FunnyType.PrimitiveOf(firstArg), FunnyType.PrimitiveOf(secondArg)); var generic = FunnyType.PrimitiveOf(returnType); Assert.IsNotNull(function); Assert.Multiple(() => { Assert.AreEqual(generic, function.ReturnType); CollectionAssert.AreEquivalent(new[] { generic, generic }, function.ArgTypes); }); }