コード例 #1
0
 /// <summary>
 /// Dispose
 /// </summary>
 public void Dispose()
 {
     CommitCompleted();
     repositoryWarehouses?.Clear();
     DomainEventManager = null;
     DomainEvents?.Clear();
 }
コード例 #2
0
        public void SetColors_GivenValidRequestNoBits()
        {
            bool called = false;

            DomainEvents.Clear();
            DomainEvents.Register <MenuColorChanging>(x => called = true);
            SetSettings(true, 0);
            var(menuCommand, chatUser) = SetUpTest();
            var commandData = new CommandData
            {
                User      = chatUser,
                Arguments = new List <string> {
                    "red"
                },
            };

            menuCommand.Execute(commandData);


            called.Should().BeTrue();
        }
コード例 #3
0
        public void SetColor_GivenEnoughBits()
        {
            bool called = false;

            DomainEvents.Clear();
            DomainEvents.Register <MenuColorChanging>(x => called = true);
            SetSettings(true, 1);
            var(menuCommand, chatUser) = SetUpTest(100);
            var commandData = new CommandData
            {
                User      = chatUser,
                Arguments = new List <string> {
                    "red", "Cheer1"
                },
                Bits    = 1,
                Message = "!menu red Cheer1"
            };

            menuCommand.Execute(commandData);

            called.Should().BeTrue();
        }
コード例 #4
0
ファイル: Entity.cs プロジェクト: wangscript007/Pole
 public void ClearDomainEvents()
 {
     DomainEvents?.Clear();
 }
コード例 #5
0
 public void Cleanup()
 {
     DomainEvents.Clear();
 }