public void Replace_Existing_Registration() { const string name = "Empty"; var type = typeof(DummyFieldBehavior); var sut = new BehaviorExtender(); sut.RegisterType(name, type); sut.Behaviors.Should() .Contain(kvp => string.Compare(kvp.Key, name, StringComparison.Ordinal) == 0 && kvp.Value == type); }
public void Add_And_Remove_Registration_Of_Additional_Behaviors() { const string name = "Mock"; var type = typeof(DummyFieldBehavior); var sut = new BehaviorExtender(); sut.RegisterType(name, type); sut.Behaviors.Should().Contain(kvp => string.Compare(kvp.Key, name, StringComparison.Ordinal) == 0 && kvp.Value == type); sut.UnregisterType(name); sut.Behaviors.Should().NotContain(kvp => string.Compare(kvp.Key, name, StringComparison.Ordinal) == 0); }