예제 #1
0
        public void ShouldNotHaveAnyDomainEvents()
        {
            var userId     = Name();
            var submission = Submission.For(userId) as IHaveDomainEvents;

            submission.DomainEvents.Should().BeEmpty();
        }
        public Task <Guid> Handle(SubmitForApproval request, CancellationToken cancellationToken)
        {
            var submission = Submission.For(request.UserId);

            submissions.Add(submission);

            return(Task.FromResult(submission.SubmissionId));
        }
예제 #3
0
        public void ShouldCreatePendingSubmission()
        {
            var submission = Submission.For(Name());

            submission.Response.Should().BeNull(because: "the submission does not have a response");
            submission.Pending.Should().Be(true, because: "the submission does not have a response");
            submission.Rejected.Should().Be(false, because: "the submission does not have a response");
            submission.Approved.Should().Be(false, because: "the submission does not have a response");
        }
예제 #4
0
        public void ShouldHaveBeenCreatedRecently()
        {
            var userId = Name();

            Submission.For(userId).Created.Should().BeCloseTo(DateTimeOffset.Now);
        }
예제 #5
0
        public void ShouldHaveTheGivenUserId()
        {
            var userId = Name();

            Submission.For(userId).UserId.Should().Be(userId);
        }
예제 #6
0
 public void Setup()
 {
     // Arrange
     submission = Submission.For(Name());
 }