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)); }
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> >()); }
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)); }