public void NamespaceTest_Tryout_ShouldLogEvent() { //arrange _experiment1 = new Experiment("test1", new Dictionary <string, object>() { { "userid", "123" } }, (assignment, objects) => { assignment.Set(_experiment1ParamName, new UniformChoiceBuilder(new Dictionary <string, object>() { { "choices", new[] { "test", "test1" } } }, _experiment1._inputs)); return(true); }); _experiment1.Log = objects => { _logs.Add(objects); }; _simpleNamespace.DefaultExperiment = _experimentDefault; _simpleNamespace.AddExperiment(_experiment1, 100); //act _simpleNamespace.LogEvent("purchase", new Dictionary <string, object>() { { "price", 1 } }); var json = JsonConvert.SerializeObject(_logs, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); //assert Assert.AreEqual(1, _logs.Count); }