コード例 #1
0
ファイル: DomainBase.Tests.cs プロジェクト: karataliu/RESTier
        public void TestDomainAppliesDomainParticipantsCorrectly()
        {
            IExpandableDomain domain = new TestDomainWithParticipants();

            var configuration = domain.Configuration;

            Assert.True(configuration.GetProperty <bool>("Test1"));
            Assert.True(configuration.GetProperty <bool>("Test2"));

            var context = domain.Context;

            Assert.True(context.GetProperty <bool>("Test1"));
            Assert.Same(domain, context.GetProperty("Test1.Self"));
            Assert.True(context.GetProperty <bool>("Test2"));
            Assert.Same(domain, context.GetProperty("Test2.Self"));

            (domain as IDisposable).Dispose();
            Assert.False(context.GetProperty <bool>("Test2"));
            Assert.False(context.GetProperty <bool>("Test1"));
        }
コード例 #2
0
        public void TestDomainAppliesDomainParticipantsCorrectly()
        {
            IExpandableDomain domain = new TestDomainWithParticipants();

            var configuration = domain.Configuration;
            Assert.True(configuration.GetProperty<bool>("Test1"));
            Assert.True(configuration.GetProperty<bool>("Test2"));

            var context = domain.Context;
            Assert.True(context.GetProperty<bool>("Test1"));
            Assert.Same(domain, context.GetProperty("Test1.Self"));
            Assert.True(context.GetProperty<bool>("Test2"));
            Assert.Same(domain, context.GetProperty("Test2.Self"));

            (domain as IDisposable).Dispose();
            Assert.False(context.GetProperty<bool>("Test2"));
            Assert.False(context.GetProperty<bool>("Test1"));
        }