public void WideSelection()
 {
     CompositeFormatter compositeFormatter = new CompositeFormatter();
     StubFormatter formatter = new StubFormatter();
     compositeFormatter.AddFormatter(typeof(IList), formatter, true);
     Assert.IsNull(compositeFormatter.SelectFormatter(typeof(Guid)));
     Assert.AreSame(formatter, compositeFormatter.SelectFormatter(typeof(ArrayList)));
     Assert.AreSame(formatter, compositeFormatter.SelectFormatter(typeof(int[])));
 }
 public void ExactSelection()
 {
     JsonTextWriter writer = new JsonTextWriter();
     CompositeFormatter compositeFormatter = new CompositeFormatter();
     compositeFormatter.AddFormatter(typeof(object), new TestFormatter());
     IJsonFormatter formatter = compositeFormatter.SelectFormatter(typeof(object));
     formatter.Format(new object(), writer);
     Assert.AreEqual("\"(object)\"", writer.ToString());
 }