public void Should_AssignDefault_If_TypeOfProject_IsNotValid()
        {
            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            expectedHandler.Execute(fakeCommand);

            fakeProjectAggregate.ProjectType.Should().Be(TypeOfProject.None);
        }
        public void Should_Retrieve_Donor()
        {
            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            expectedHandler.Execute(fakeCommand);

            mockRepository
            .Verify(x => x.Get <DonorAggregate>(), Times.Once());
        }
        public void Should_Return_ValidMessage_When_Succeed()
        {
            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            var result = expectedHandler.Execute(fakeCommand);

            result.Success.Should().BeTrue();
            result.Reason.Should().BeNullOrEmpty();
        }
        public void Should_AssignCorrect_If_TypeOfProject_IsValid()
        {
            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            fakeCommand = new CreateProjectCommand(fakeDonor.Id, fakeAnalyst.Id, "acronym", "TaPackage", "fake", DateTime.UtcNow);

            expectedHandler.Execute(fakeCommand);

            fakeProjectAggregate.ProjectType.Should().Be(TypeOfProject.TaPackage);
        }
        public void Should_AssignCorrect_If_TypeOfTender_IsValid()
        {
            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            fakeCommand = new CreateProjectCommand(fakeDonor.Id, fakeAnalyst.Id, "acronym", "fake", "NegotiatedProcedure", DateTime.UtcNow);

            expectedHandler.Execute(fakeCommand);

            fakeProjectAggregate.TenderProcessType.Should().Be(TypeOfTenderProcess.NegotiatedProcedure);
        }
        public void Should_Return_ValidMessage_When_Fails()
        {
            // throw exception
            mockUnitOfWork.Setup(x => x.CreateRepository())
            .Throws <NotImplementedException>();

            var expectedHandler = new CreateProjectHandler(mockUnitOfWork.Object);

            var result = expectedHandler.Execute(fakeCommand);

            result.Success.Should().BeFalse();
            result.Reason.Should().NotBeNullOrEmpty();
        }