Exemplo n.º 1
0
        public void Has_returns_false_for_a_type_which_was_not_added(ResolvedServiceCache sut)
        {
            // Act
            var result = sut.Has(new ServiceRegistrationKey(typeof(ISampleService), null));

            // Assert
            Assert.That(result, Is.False);
        }
Exemplo n.º 2
0
        public void Has_returns_false_for_a_service_which_was_added_under_a_different_name([Registration(ServiceType = typeof(ISampleService), Name = "A name")] IServiceRegistration registration,
                                                                                           ResolvedServiceCache sut,
                                                                                           SampleServiceImplementationOne instance)
        {
            // Act
            sut.Add(registration, instance);
            var result = sut.Has(new ServiceRegistrationKey(typeof(SampleServiceImplementationOne), "Other name"));

            // Assert
            Assert.That(result, Is.False);
        }
Exemplo n.º 3
0
        public void Has_returns_true_for_a_named_implementation_type_after_it_is_added([Registration(ServiceType = typeof(ISampleService), Name = "A name")] IServiceRegistration registration,
                                                                                       ResolvedServiceCache sut,
                                                                                       SampleServiceImplementationOne instance)
        {
            // Act
            sut.Add(registration, instance);
            var result = sut.Has(new ServiceRegistrationKey(typeof(SampleServiceImplementationOne), registration.Name));

            // Assert
            Assert.That(result, Is.True);
        }