示例#1
0
            public async Task should_not_throw()
            {
                var args = new CommandArgs {
                    Text = "Just testing!".AsMemory()
                };

                var sut = new IdeaCommand((x, y) => { });

                await sut.Execute(ChatServiceMock.Object, args);
            }
示例#2
0
            public async Task should_invoke_writer()
            {
                var args = new CommandArgs {
                    Text = "Just testing!".AsMemory()
                };

                var writerInvoked = false;

                void fakeWriteIdea(string ideaPath, CommandArgs cargs)
                {
                    writerInvoked = true;
                }

                var sut = new IdeaCommand(fakeWriteIdea);

                await sut.Execute(ChatServiceMock.Object, args);

                writerInvoked.ShouldBe(true);
            }
示例#3
0
            public async Task should_generate_file_path_with_date()
            {
                var args = new CommandArgs {
                    Text = "Just testing!".AsMemory()
                };

                string generatedIdeaPath = null;

                void fakeWriteIdea(string ideaPath, CommandArgs cargs)
                {
                    generatedIdeaPath = ideaPath;
                }

                var expectedIdeaPath = $@"c:\dev\ideas-{DateTime.Now:MM-dd-yyyy}.txt";

                var sut = new IdeaCommand(fakeWriteIdea);

                await sut.Execute(ChatServiceMock.Object, args);

                generatedIdeaPath.ShouldBe(expectedIdeaPath);
            }