public void Setup()
        {
            var fakeuser = new FakeDiscordUser()
            {
                Username           = "******",
                DiscriminatorValue = 1234,
                Id = 123456789123456789
            };

            var user = new Member(fakeuser);

            var client = new FakeDiscordClient()
            {
                FakeApplication = new FakeApplication()
                {
                    Owner = fakeuser
                }
            };

            var guild = new FakeGuild()
            {
            };

            var messageChannel = new FakeMessageChannel()
            {
            };

            var message = new FakeUserMessage()
            {
                Author = fakeuser
            };

            _memberRepository = new FakeMemberRepository();

            _projectRepository = new FakeProjectRepository()
            {
                Projects = new Dictionary <int, Project>()
                {
                    { 0, new Project("UnitTestProject", user) },
                }
            };

            _logic = new JoinProjectLogic(Log.Logger.ForContext(GetType()), new FakeCommandContext()
            {
                Channel = messageChannel,
                Client  = client,
                Guild   = guild,
                Message = message,
                User    = fakeuser
            }, new ProjectManager(_memberRepository, _projectRepository), "UnitTestProject");
        }
示例#2
0
        public void Setup()
        {
            var user = new FakeDiscordUser()
            {
                Username           = "******",
                DiscriminatorValue = 1234,
                Id = 123456789123456789
            };

            var client = new FakeDiscordClient()
            {
                FakeApplication = new FakeApplication()
                {
                    Owner = user
                }
            };

            var guild = new FakeGuild()
            {
            };

            var messageChannel = new FakeMessageChannel()
            {
            };

            var message = new FakeUserMessage()
            {
                Author  = user,
                Content = "debug!makechannel make-me"
            };

            _logic = new MakeChannelLogic(Log.Logger.ForContext(GetType()), new FakeCommandContext()
            {
                Client  = client,
                Guild   = guild,
                User    = user,
                Message = message,
                Channel = messageChannel
            }, "unit-test");
        }