Ejemplo n.º 1
0
        public void Execute_RowCountEmptyResultSet_CorrectResult()
        {
            var rsArgs = new ObjectsResultSetResolverArgs(
                new List <object[]>()
            {
            });
            var args     = new RowCountResultSetScalarResolverArgs(rsArgs);
            var resolver = new ProjectionResultSetScalarResolver <int>(args);

            Assert.That(resolver.Execute(), Is.EqualTo(0));
        }
Ejemplo n.º 2
0
        public void Instantiate_ProjectionResultSetArgs_ProjectionResultSetResolver()
        {
            var args = new RowCountResultSetScalarResolverArgs(new ResultSetResolverArgs());
            var stub = new Mock <ServiceLocator>();

            stub.Setup(x => x.GetResultSetResolverFactory()).Returns(new ResultSetResolverFactory(stub.Object));

            var factory  = new ScalarResolverFactory(stub.Object);
            var resolver = factory.Instantiate <object>(args);

            Assert.That(resolver, Is.TypeOf <ProjectionResultSetScalarResolver <object> >());
        }
Ejemplo n.º 3
0
        public void Execute_RowCount_CorrectResult()
        {
            var rsArgs = new ObjectsResultSetResolverArgs(
                new List <object[]>()
            {
                new object[] { "alpha", 1 },
                new object[] { "beta", 2 },
                new object[] { "Gamma", 3 }
            });
            var args     = new RowCountResultSetScalarResolverArgs(rsArgs);
            var resolver = new ProjectionResultSetScalarResolver <int>(args);

            Assert.That(resolver.Execute(), Is.EqualTo(3));
        }