public async Task HandleGetInvitationsByCommPkgNoQuery_ShouldReturnEmptyListOfInvitations_IfNoInvitationsFound()
        {
            using (var context = new IPOContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut = new GetLatestMdpIpoStatusOnCommPkgsQueryHandler(context);

                var result = await dut.Handle(new GetLatestMdpIpoStatusOnCommPkgsQuery(new List <string> {
                    "Unknown"
                }, _projectName), default);

                Assert.AreEqual(0, result.Data.Count);
            }
        }
        public async Task HandleGetInvitationsByCommPkgNoQuery_ShouldReturnOkResult()
        {
            using (var context = new IPOContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var query = new GetLatestMdpIpoStatusOnCommPkgsQuery(new List <string> {
                    _commPkgNo1, _commPkgNo2
                }, _projectName);
                var dut    = new GetLatestMdpIpoStatusOnCommPkgsQueryHandler(context);
                var result = await dut.Handle(query, default);

                Assert.AreEqual(ResultType.Ok, result.ResultType);
            }
        }
        public async Task HandleGetInvitationsByCommPkgNoQuery_ShouldReturn1Invitation()
        {
            using (var context = new IPOContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var query = new GetLatestMdpIpoStatusOnCommPkgsQuery(new List <string> {
                    _commPkgNo2
                }, _projectName);
                var dut = new GetLatestMdpIpoStatusOnCommPkgsQueryHandler(context);

                var result = await dut.Handle(query, default);

                Assert.IsNotNull(result);
                Assert.AreEqual(ResultType.Ok, result.ResultType);

                var commPkgsWithMdpIposDtos = result.Data;
                Assert.AreEqual(1, commPkgsWithMdpIposDtos.Count);

                Assert.IsNotNull(commPkgsWithMdpIposDtos.SingleOrDefault(i => i.LatestMdpInvitationId == _mdpInvitationId2));
            }
        }