Example #1
0
        public void IdentifyTenant_FailedRetrieval()
        {
            var strategy = new StubTenantIdentificationStrategy
            {
                IdentificationSuccess = false
            };

            Assert.Equal(Guid.Empty, strategy.IdentifyTenant <Guid>());
        }
Example #2
0
        public void IdentifyTenant_FailedConversion()
        {
            var strategy = new StubTenantIdentificationStrategy
            {
                TenantId = Guid.NewGuid()
            };

            Assert.Throws <InvalidCastException>(() => strategy.IdentifyTenant <int>());
        }
        public void IdentifyTenant_FailedRetrieval()
        {
            var strategy = new StubTenantIdentificationStrategy
            {
                IdentificationSuccess = false
            };

            Assert.AreEqual(Guid.Empty, strategy.IdentifyTenant <Guid>(), "The tenant ID should be the default for the type if identification fails.");
        }
Example #4
0
        public void IdentifyTenant_SuccessfulRetrieval()
        {
            var expected = Guid.NewGuid();
            var strategy = new StubTenantIdentificationStrategy
            {
                TenantId = expected
            };

            Assert.Equal(expected, strategy.IdentifyTenant <Guid>());
        }
        public void IdentifyTenant_SuccessfulRetrieval()
        {
            var expected = Guid.NewGuid();
            var strategy = new StubTenantIdentificationStrategy
            {
                TenantId = expected
            };

            Assert.AreEqual(expected, strategy.IdentifyTenant <Guid>(), "The tenant ID wasn't properly retrieved and parsed.");
        }