Esempio n. 1
0
        public void AssertIsValid_does_not_throw_when_implementation_type_is_same_as_service_type(ISelectsConstructor ctorSelector)
        {
            // Arrange
            var sut = new TypeRegistration(typeof(SampleServiceImplementationOne), ctorSelector)
            {
                ServiceType = typeof(SampleServiceImplementationOne),
            };

            // Act & assert
            Assert.That(() => sut.AssertIsValid(), Throws.Nothing);
        }
Esempio n. 2
0
        public void AssertIsValid_throws_exception_if_implementation_type_does_not_derive_from_service_type(ISelectsConstructor ctorSelector)
        {
            // Arrange
            var sut = new TypeRegistration(typeof(SampleServiceImplementationOne), ctorSelector)
            {
                ServiceType = typeof(IEnumerable),
            };

            // Act & assert
            Assert.That(() => sut.AssertIsValid(), Throws.InstanceOf <InvalidTypeRegistrationException>());
        }