Beispiel #1
0
        private static Mock <IBrainstormingDalService> BrainstormingDalMock(int initRound)
        {
            var brainstormingDalMock = new Mock <IBrainstormingDalService>();

            brainstormingDalMock.SetupSequence(request => request.GetFinding(It.IsAny <string>())).
            Returns(BrainstormingModelFactory.CreateFinding(initRound));
            return(brainstormingDalMock);
        }
Beispiel #2
0
        private BrainstormingService BasicServiceSetup()
        {
            var brainstormingDalMock = new Mock <IBrainstormingDalService>();

            brainstormingDalMock.SetupSequence(request => request.GetFinding(It.IsAny <string>()))
            .Returns(BrainstormingModelFactory.CreateFinding(1))
            .Returns(BrainstormingModelFactory.CreateFinding(-1));

            brainstormingDalMock.Setup(req => req.UpdateSheet(It.IsAny <string>(), It.IsAny <BrainSheet>()))
            .Returns(true);

            var participantDalMock = new Mock <IParticipantDalService>();
            var teamDalMock        = TeamDalMock();

            var model = new BrainstormingModel()
            {
                BrainSheets = new ObservableCollection <BrainSheet>()
            };
            var context = BrainstormingModelFactory.CreateContext(1);

            context.CurrentFinding.BrainSheets = new List <BrainSheet>()
            {
                new BrainSheet()
            };

            var dalMock = new Mock <IDalService>();

            dalMock.Setup(s => s.BrainstormingDalService).Returns(brainstormingDalMock.Object);
            dalMock.Setup(s => s.ParticipantDalService).Returns(participantDalMock.Object);
            dalMock.Setup(s => s.TeamDalService).Returns(teamDalMock.Object);

            var brainstormingService = new BrainstormingService(
                _logMock,
                dalMock.Object,
                context,
                model
                );

            return(brainstormingService);
        }