public void Should_not_be_able_to_add_Policy_with_duplicate_key_using_Add() { Policy policy = Policy.NoOp(); string key = Guid.NewGuid().ToString(); _registry.Invoking(r => r.Add(key, policy)) .Should().NotThrow(); _registry.Invoking(r => r.Add(key, policy)) .Should().Throw <ArgumentException>(); _registry.Count.Should().Be(1); }