Exemple #1
0
        public void Reset_ShouldDeleteAllUsers()
        {
            var mockedCommandReader    = new Mock <ICommandReader>();
            var mockedCommandProcessor = new Mock <ICommandProcessor>();
            var mockedReportPrinter    = new Mock <IReportPrinter>();

            mockedReportPrinter.Setup(x => x.PrintReports(It.IsAny <IEnumerable <string> >()));
            var mockedUserService = new Mock <IUserService>();

            mockedUserService.Setup(x => x.DeleteAllUsers());
            var engine = new DealershipEngine(mockedCommandReader.Object, mockedCommandProcessor.Object, mockedReportPrinter.Object, mockedUserService.Object);

            engine.Reset();

            mockedUserService.Verify(x => x.DeleteAllUsers(), Times.Once);
        }
Exemple #2
0
        public void Reset_ShouldCallDataProviderWipeData_IfCalled()
        {
            var writerMock            = new Mock <IWriter>();
            var dataProviderMock      = new Mock <IDataProvider>();
            var commandManagerMock    = new Mock <ICommandManager>();
            var dealershipFactoryMock = new Mock <IDealershipFactory>();

            var dealershipEngine = new DealershipEngine(
                writerMock.Object,
                dataProviderMock.Object,
                commandManagerMock.Object,
                dealershipFactoryMock.Object);

            dealershipEngine.Start();
            dealershipEngine.Reset();

            dataProviderMock.Verify(x => x.WipeData(), Times.Once);
        }