public void ReturnsExceptionWhenNotAvaliable_Single()
        {
            var fact            = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance);
            var stringConverter = fact.Get <DateTime>();

            Assert.That(stringConverter, Is.Null);
        }
 public void ReturnsExceptionWhenNotAvaliable_Multiple()
 {
     var fact = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance,
                                                   TupleDatumConverterFactory.Instance);
     var stringConverter = fact.Get<DateTime>();
     Assert.That(stringConverter, Is.Null);
 }
        public void ReturnsAvailableConverter_Single()
        {
            var fact = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance);
            var stringConverter = fact.Get<string>();
            Assert.That(stringConverter, Is.Not.Null);
            Assert.That(stringConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.StringDatumConverter)));

            var intConverter = fact.Get<int>();
            Assert.That(intConverter, Is.Not.Null);
            Assert.That(intConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.IntDatumConverter)));
        }
        public void ReturnsAvailableConverter_Multiple()
        {
            var fact = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance,
                                                          DateTimeDatumConverterFactory.Instance);

            var stringConverter = fact.Get<string>();
            Assert.That(stringConverter, Is.Not.Null);
            Assert.That(stringConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.StringDatumConverter)));

            var datetimeConverter = fact.Get<DateTime>();
            Assert.That(datetimeConverter, Is.Not.Null);
            Assert.That(datetimeConverter, Is.TypeOf(typeof(DateTimeDatumConverter)));
        }
        public void ReturnsAvailableConverter_Single()
        {
            var fact            = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance);
            var stringConverter = fact.Get <string>();

            Assert.That(stringConverter, Is.Not.Null);
            Assert.That(stringConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.StringDatumConverter)));

            var intConverter = fact.Get <int>();

            Assert.That(intConverter, Is.Not.Null);
            Assert.That(intConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.IntDatumConverter)));
        }
        public void ReturnsAvailableConverter_Multiple()
        {
            var fact = new AggregateDatumConverterFactory(PrimitiveDatumConverterFactory.Instance,
                                                          DateTimeDatumConverterFactory.Instance);

            var stringConverter = fact.Get <string>();

            Assert.That(stringConverter, Is.Not.Null);
            Assert.That(stringConverter, Is.TypeOf(typeof(PrimitiveDatumConverterFactory.StringDatumConverter)));

            var datetimeConverter = fact.Get <DateTime>();

            Assert.That(datetimeConverter, Is.Not.Null);
            Assert.That(datetimeConverter, Is.TypeOf(typeof(DateTimeDatumConverter)));
        }
Esempio n. 7
0
 public Connection()
 {
     DatumConverterFactory = new AggregateDatumConverterFactory(
         PrimitiveDatumConverterFactory.Instance,
         DataContractDatumConverterFactory.Instance,
         DateTimeDatumConverterFactory.Instance,
         DateTimeOffsetDatumConverterFactory.Instance,
         GuidDatumConverterFactory.Instance,
         UriDatumConverterFactory.Instance,
         TupleDatumConverterFactory.Instance,
         ArrayDatumConverterFactory.Instance,
         AnonymousTypeDatumConverterFactory.Instance,
         EnumDatumConverterFactory.Instance,
         NullableDatumConverterFactory.Instance,
         ListDatumConverterFactory.Instance,
         TimeSpanDatumConverterFactory.Instance
         );
     ConnectTimeout = QueryTimeout = TimeSpan.FromSeconds(30);
 }