Exemplo n.º 1
0
        public void ResolveRegistry_DifferentTriggerType_ReturnsDifferentInstance()
        {
            var subject    = new TriggerTypeRegistryService();
            var entityType = typeof(object);

            var registry1 = subject.ResolveRegistry(typeof(IBeforeSaveTrigger <>), entityType, _ => null);
            var registry2 = subject.ResolveRegistry(typeof(IAfterSaveTrigger <>), entityType, _ => null);

            Assert.NotEqual(registry1, registry2);
        }
Exemplo n.º 2
0
        public void ResolveRegistry_DifferentEntityType_ReturnsSameInstance()
        {
            var subject     = new TriggerTypeRegistryService();
            var triggerType = typeof(IBeforeSaveTrigger <>);

            var registry1 = subject.ResolveRegistry(triggerType, typeof(object), _ => null);
            var registry2 = subject.ResolveRegistry(triggerType, typeof(string), _ => null);

            Assert.NotEqual(registry1, registry2);
        }
Exemplo n.º 3
0
        public void ResolveRegistry_SameTypePattern_ReturnsSameInstance()
        {
            var subject     = new TriggerTypeRegistryService();
            var triggerType = typeof(IBeforeSaveTrigger <>);
            var entityType  = typeof(object);

            var registry1 = subject.ResolveRegistry(triggerType, entityType, _ => null);
            var registry2 = subject.ResolveRegistry(triggerType, entityType, _ => null);

            Assert.Equal(registry1, registry2);
        }