Example #1
0
        public void Setup()
        {
            IEnumerable <ServiceDescriptor> serviceDescriptors = new ServiceDescriptor[0];

            subject = new Mock <IServiceCollection>();
            subject
            .Setup(instance => instance.GetEnumerator())
            .Returns(serviceDescriptors.GetEnumerator());

            ServiceExtensions.RegisterServices(subject.Object, new[] { typeof(ITransientInterface).Assembly });
        }
        public void ThenAnArgumentNullExceptionIsThrown()
        {
            ArgumentNullException exception = Assert.Throws <ArgumentNullException>(() => ServiceExtensions.RegisterServices(Mock.Of <IServiceCollection>(), null));

            Assert.AreEqual("assemblies", exception.ParamName);
        }
        public void ThenAnArgumentNullExceptionIsThrown()
        {
            ArgumentNullException exception = Assert.Throws <ArgumentNullException>(() => ServiceExtensions.RegisterServices(null, new Assembly[0]));

            Assert.AreEqual("services", exception.ParamName);
        }
Example #4
0
        public void Setup()
        {
            subject = new Mock <IServiceCollection>();

            ServiceExtensions.RegisterServices(subject.Object, new Assembly[0]);
        }