Пример #1
0
        public void GetService_WidgetRegistered_InstanceOfWidget()
        {
            var sut = new FakeResolver(FakeResolver.Register(typeof(Widget), () => new Widget()));

            var result = sut.GetService(typeof(Widget));

            Assert.IsType<Widget>(result);
        }
Пример #2
0
        public void GetService_NonRegistered_Null()
        {
            var sut = new FakeResolver();

            var instance = sut.GetService(typeof(Widget));

            Assert.Null(instance);
        }