Ejemplo n.º 1
0
        public void AddAttachments_ThenDeleteAttachments_AttachmentsChangedSuccessfully()
        {
            //Arrange
            var applicationDraft = DraftApplicationFactory.CreateValid();

            var applicationDraftAttachments = this._testFixture.CreateAttachments(2);

            //Act
            applicationDraft.AddAttachments(applicationDraftAttachments);
            applicationDraft.DeleteAttachments(new List <StorageId> {
                applicationDraftAttachments.First().StorageId
            }
                                               .AsEnumerable());

            //Assert
            var attachmentsAddedEvent   = AssertPublishedDomainEvent <DraftApplicationAttachmentsAdded>(applicationDraft);
            var attachmentsDeletedEvent =
                AssertPublishedDomainEvent <DraftApplicationAttachmentsDeleted>(applicationDraft);

            Assert.NotNull(attachmentsAddedEvent);
            Assert.NotNull(attachmentsDeletedEvent);

            Assert.AreEqual(2, attachmentsAddedEvent.AddedAttachments.Count());
            Assert.AreEqual(1, attachmentsDeletedEvent.DeletedAttachments.Count());
            Assert.AreEqual(1, applicationDraft.Attachments.Count());
        }
Ejemplo n.º 2
0
        public void AllFieldsAreFilled_CreatedSuccessfully()
        {
            var applicationDraft = DraftApplicationFactory.CreateValid();

            var draftCreated = AssertPublishedDomainEvent <DraftApplicationCreated>(applicationDraft);

            Assert.NotNull(draftCreated);
        }
Ejemplo n.º 3
0
        public TestFixture(IIncidentApplicationRepository incidentApplicationRepository,
                           IDraftApplicationRepository draftApplicationRepository)
        {
            this._incidentApplicationRepository = incidentApplicationRepository;
            this._draftApplicationRepository    = draftApplicationRepository;

            this._draftApplicationFactory     = new DraftApplicationFactory();
            this._draftApplicationTestFixture = new DraftApplicationTestFixture();
        }
Ejemplo n.º 4
0
        public void AddAttachments_AddedSuccessfully()
        {
            //Arrange
            var applicationDraft = DraftApplicationFactory.CreateValid();

            //Act
            applicationDraft.AddAttachments(this._testFixture.CreateAttachments(2));

            //Assert
            var attachmentsAddedEvent = AssertPublishedDomainEvent <DraftApplicationAttachmentsAdded>(applicationDraft);

            Assert.NotNull(attachmentsAddedEvent);
            Assert.AreEqual(2, applicationDraft.Attachments.Count());
        }
Ejemplo n.º 5
0
 public TestFixture()
 {
     this._draftApplicationFactory     = new DraftApplicationFactory();
     this._draftApplicationTestFixture = new DraftApplicationTestFixture();
 }
Ejemplo n.º 6
0
 public TestFixture(IDraftApplicationRepository draftApplicationRepository)
 {
     this._draftApplicationFactory     = new DraftApplicationFactory();
     this._draftApplicationTestFixture = new DraftApplicationTestFixture();
     this._draftApplicationRepository  = draftApplicationRepository;
 }