public void UsesTheFunctionPassedInToDetermineTheKeyOfAnObject() { var item = new Foo {Bar = "a", Baz = "z"}; var collection = new FunctionalKeyedCollection<string, Foo>(foo => foo.Bar) { item }; Assert.That(collection["a"], Is.SameAs(item)); Assert.That(() => collection["z"], Throws.Exception); }
public void UsesTheFunctionPassedInToDetermineTheKeyOfAnObject() { var item = new Foo { Bar = "a", Baz = "z" }; var collection = new FunctionalKeyedCollection <string, Foo>(foo => foo.Bar) { item }; Assert.That(collection["a"], Is.SameAs(item)); Assert.That(() => collection["z"], Throws.Exception); }