public void TestGetMapReduceObject() { MapReduce mr = mrcol.MapReduce(); Assert.IsNotNull(mr); Assert.AreEqual(mrcol.Name, mr.Name); }
public void TestBuilderSetsAllProperties() { Document query = new Document().Append("x", 1); Document scope = new Document().Append("y", 2); Document sort = new Document().Append("z", 3); MapReduceBuilder mrb = mrcol.MapReduceBuilder(); mrb.Map(mapfunction) .Reduce(reducefunction) .KeepTemp(true) .Limit(5) .Out("outtest") .Query(query) .Scope(scope) .Sort(sort) .Verbose(false); MapReduce mr = mrb.MapReduce; Assert.AreEqual(query.ToString(), mr.Query.ToString()); Assert.AreEqual(scope.ToString(), mr.Scope.ToString()); Assert.AreEqual(sort.ToString(), mr.Sort.ToString()); Assert.AreEqual(true, mr.KeepTemp); Assert.AreEqual(5, mr.Limit); Assert.AreEqual("outtest", mr.Out); Assert.AreEqual(false, mr.Verbose); }
public void TestExecuteSimple() { MapReduce mr = mrcol.MapReduce(); mr.Map = new Code(mapfunction); mr.Reduce = new Code(reducefunction); mr.Execute(); Assert.IsNotNull(mr.Result); }
public void TestCreateMapReduceWithStringFunctions() { MapReduce mr = mrcol.MapReduce(); MapReduceBuilder mrb = new MapReduceBuilder(mr); mrb.Map(mapfunction).Reduce(reducefunction); Assert.IsNotNull(mr.Map); Assert.IsNotNull(mr.Reduce); }
public void TestExecuteSimple() { MapReduceBuilder mrb = mrcol.MapReduceBuilder(); MapReduce mr = mrb.Map(mapfunction).Reduce(reducefunction).Execute(); Assert.IsNotNull(mr.Result); Assert.IsTrue(mr.Result.Ok); Assert.AreEqual(4, mr.Result.InputCount); Assert.AreEqual(6, mr.Result.EmitCount); Assert.AreEqual(3, mr.Result.OutputCount); }
public void TestExecuteUsing() { String tempcollname = null; using (MapReduceBuilder mrb = mrcol.MapReduceBuilder().Map(mapfunction).Reduce(reducefunction)){ MapReduce mr = mrb.Execute(); Assert.IsNotNull(mr.Result); Assert.IsTrue(mr.Result.Ok); tempcollname = tests.Name + "." + mr.Result.CollectionName; bool found = false; Assert.IsTrue(tests.GetCollectionNames().Contains(tempcollname)); } Assert.IsFalse(tests.GetCollectionNames().Contains(tempcollname)); }
public MapReduceBuilder(MapReduce mr) { this.mr = mr; }
public MongoMapReduceException(MongoCommandException mce, MapReduce mr) : base(mce.Message, mce.Error, mce.Command) { mrr = new MapReduce.MapReduceResult(mce.Error); }
public MongoMapReduceException(MongoCommandException mce, MapReduce mr) : base(mce.Message,mce.Error, mce.Command) { mrr = new MapReduce.MapReduceResult(mce.Error); }