public void testCustomBuilder()
 {
     string name = "customName";
     string extension = "custom";
     var sinkBuilder = new TsdQueryLogSink.Builder(name).SetExtension(extension).SetImmediateFlush(false).SetMaxRollBackups(12).RollDaily();
     Assert.AreEqual(name, sinkBuilder.Name);
     Assert.AreEqual("", sinkBuilder.Path);
     Assert.AreEqual(TsdQueryLogSink.Builder.RollPeriodE.Daily, sinkBuilder.RollPeriod);
     Assert.AreEqual(extension, sinkBuilder.Extension);
     Assert.AreEqual(12, sinkBuilder.MaxRollBackups);
     Assert.AreEqual(false, sinkBuilder.ImmediateFlush);
     var sink = sinkBuilder.Build() as TsdQueryLogSink;
     Assert.AreEqual(12, sink.Appender.MaxSizeRollBackups);
     Assert.AreEqual(false, sink.Appender.ImmediateFlush);
     var file = sink.Appender.File;
     var date = DateTime.Now;
     Assert.AreEqual(String.Format("{1}.{2}.{0}", date.ToString("yyyy-MM-dd"), name, extension), System.IO.Path.GetFileName(file));
 }
 public void testBuilderWithDefaults()
 {
     var sinkBuilder = new TsdQueryLogSink.Builder("query");
     Assert.AreEqual("query", sinkBuilder.Name);
     Assert.AreEqual("", sinkBuilder.Path);
     Assert.AreEqual(TsdQueryLogSink.Builder.RollPeriodE.Hourly, sinkBuilder.RollPeriod);
     Assert.AreEqual("log", sinkBuilder.Extension);
     Assert.AreEqual(24, sinkBuilder.MaxRollBackups);
     Assert.AreEqual(true, sinkBuilder.ImmediateFlush);
     var sink = sinkBuilder.Build() as TsdQueryLogSink;
     Assert.AreEqual(24, sink.Appender.MaxSizeRollBackups);
     Assert.AreEqual(true, sink.Appender.ImmediateFlush);
     var file = sink.Appender.File;
     var date = DateTime.Now;
     Assert.AreEqual(String.Format("query.log.{0}", date.ToString("yyyy-MM-dd-HH")), System.IO.Path.GetFileName(file));
 }