public void AdjustDataType_GenericTypeDefinition_FromCovariantDataType() { var info = new StreamedSequenceInfo(typeof(IEnumerable <object>), _stringExpression); var result = info.AdjustDataType(typeof(IQueryable <>)); Assert.That(result, Is.Not.SameAs(info)); Assert.That(result, Is.TypeOf(typeof(StreamedSequenceInfo))); Assert.That(result.DataType, Is.SameAs(typeof(IQueryable <object>))); Assert.That(((StreamedSequenceInfo)result).ResultItemType, Is.SameAs(typeof(object))); Assert.That(((StreamedSequenceInfo)result).ItemExpression, Is.SameAs(_stringExpression)); }
public void AdjustDataType_SameType() { var result = _infoWithStringSequence.AdjustDataType(typeof(IEnumerable <string>)); Assert.That(result, Is.Not.SameAs(_infoWithStringSequence)); Assert.That(result, Is.TypeOf(typeof(StreamedSequenceInfo))); Assert.That(result.DataType, Is.SameAs(typeof(IEnumerable <string>))); Assert.That(((StreamedSequenceInfo)result).ItemExpression, Is.SameAs(_infoWithStringSequence.ItemExpression)); Assert.That(((StreamedSequenceInfo)result).ResultItemType, Is.SameAs(typeof(string))); }
public void AdjustDataType_GenericTypeDefinition_FromCovariantDataType () { var info = new StreamedSequenceInfo (typeof (IEnumerable<object>), _stringExpression); var result = info.AdjustDataType (typeof (IQueryable<>)); Assert.That (result, Is.Not.SameAs (info)); Assert.That (result, Is.TypeOf (typeof (StreamedSequenceInfo))); Assert.That (result.DataType, Is.SameAs (typeof (IQueryable<object>))); Assert.That (((StreamedSequenceInfo) result).ResultItemType, Is.SameAs (typeof (object))); Assert.That (((StreamedSequenceInfo) result).ItemExpression, Is.SameAs (_stringExpression)); }