Пример #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());
 }