public async Task BindingInstanceReturnsSameObjectAfterBinding()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     obj     = new TestImplA("test", 10);

            ITestInterface result = await service.RegisterInstanceAsync <ITestInterface, TestImplA>(obj, "mytestinstance");

            Assert.Equal(result.Content, obj.Content);
        }
        public async Task RetrievingNotBoundInstanceReturnsNull()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     obj     = new TestImplA("test", 10);

            await service.RegisterInstanceAsync <ITestInterface, TestImplA>(obj, "mytestinstance");

            ITestInterface result = await service.GetInstanceAsync <ITestInterface>("someotherinstance");

            Assert.Null(result);
        }
        public async Task RetrieveNamedInstance()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     obj     = new TestImplA("test", 10);

            await service.RegisterInstanceAsync <ITestInterface, TestImplA>(obj, "mytestinstance");

            ITestInterface a = await service.GetInstanceAsync <ITestInterface>("mytestinstance");

            Assert.Equal("test10", a.Content);
        }
        public async Task BindAndRetrieveInstance()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     obj     = new TestImplA("test", 10);

            await service.RegisterInstanceAsync <ITestInterface, TestImplA>(obj);

            ITestInterface a = await service.GetInstanceAsync <ITestInterface>();

            Assert.Equal(a.Content, obj.Content);
        }
        public async Task NamedInstancesReturnTheSameObject()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     obj     = new TestImplA("test", 10);

            await service.RegisterInstanceAsync <ITestInterface, TestImplA>(obj, "mytestinstance");

            ITestInterface a = await service.GetInstanceAsync <ITestInterface>("mytestinstance");

            ITestInterface b = await service.GetInstanceAsync <ITestInterface>("mytestinstance");

            Assert.Equal(b, a);
        }
        public async Task BoundInstancesOfSameInterfaceTypeAreNotEqual()
        {
            IDependencyService service = new DependencyService();
            ITestInterface     implA   = new TestImplA("test", 10);
            ITestInterface     implB   = new TestImplB("test", 10);

            await service.RegisterInstanceAsync <ITestInterface, TestImplA>(implA, "a");

            await service.RegisterInstanceAsync <ITestInterface, TestImplB>(implB, "b");

            ITestInterface a = await service.GetInstanceAsync <ITestInterface>("a");

            ITestInterface b = await service.GetInstanceAsync <ITestInterface>("b");

            Assert.NotEqual(a, b);
        }