public static void Main()
        {
            var db            = new NobelPrizeWinnersDbContext();
            var winnerService = new WinnerService(db);

            winnerService.Run();
        }
Пример #2
0
 public void Insert_ShouldReturn_NonNull_Boolean()
 {
     //Act
     IWinnerService service = new WinnerService();
     bool result = service.Insert(new WinnerDTO());
     //Assert
     Assert.IsInstanceOfType(result, typeof (bool));
 }
Пример #3
0
 public void DeleteAll_ShouldReturn_NonNull_Boolean()
 {
     using (new TransactionScope()) {
         //Act
         IWinnerService service = new WinnerService();
         bool result = service.DeleteAll();
         //Assert
         Assert.IsInstanceOfType(result, typeof (bool));
     }
 }
        public ReportServiceTest()
        {
            _googleSearchRepositoryMockBuilder = new SearchRepositoryMockBuilder();
            _bingSearchRepositoryMockBuilder   = new SearchRepositoryMockBuilder();
            IEnumerable <ISearchRepository> repositories = BuildIEnumerableSearchRepositories();
            var searchService = new SearchService(repositories);
            var winnerservice = new WinnerService();

            _reportService = new ReportService(searchService, winnerservice);
        }
Пример #5
0
 public Service()
 {
     Action   = new ActionService();
     Board    = new BoardService();
     Language = new LanguageService();
     Player   = new PlayerService();
     Sound    = new SoundService();
     Storage  = new StorageService();
     Timer    = new TimerService();
     Winner   = new WinnerService();
 }
Пример #6
0
 public void Insert_ShouldReturn_NonNull_Boolean()
 {
     using (new TransactionScope()) {
         //Arrange
         long attendeeID = new AttendeeService().GetAll()[0].AttendeeID;
         long sponsorID = new SponsorService().GetAllThatProvidedSwag()[0].SponsorID;
         long swagID = new SwagService().GetAllBySponsor(sponsorID)[0].SwagID;
         //Act
         IWinnerService service = new WinnerService();
         bool result = service.Insert(new WinnerDTO {AttendeeID = attendeeID, SponsorID = sponsorID, SwagID = swagID, Name = "Big Winner",});
         //Assert
         Assert.IsInstanceOfType(result, typeof (bool));
     }
 }
        public void GivenTwoSearchEnginesAreSet()
        {
            _googleSearchEngineRepository = new MockSearchEngineRepository()
                                            .SetSearchEngineName("Google")
                                            .SetSearchResults();
            _bingSearchEngineRepository = new MockSearchEngineRepository()
                                          .SetSearchEngineName("Bing")
                                          .SetSearchResults();

            var searchService = new SearchService(new List <ISearchEngineRepository>()
            {
                _googleSearchEngineRepository.Object, _bingSearchEngineRepository.Object
            });

            var winnerService = new WinnerService();

            _reportService = new ReportService(searchService, winnerService);
        }
Пример #8
0
        public void GetWinner_WhenCheckedSquaresAreTheSame_ReturnsTrue(int[] squares)
        {
            // Arrange
            IWinnerService classUnderTest = new WinnerService();
            var            player         = Player.O;
            var            expected       = true;

            var game = new Game();

            game.SetPosition(player, squares[0]);
            game.SetPosition(player, squares[1]);
            game.SetPosition(player, squares[2]);
            var currentBoard = game.GetCurrentBoard();

            // Act
            var actual = classUnderTest
                         .GetWinner(currentBoard)
                         .HasWon;

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #9
0
 public PickAWinnerController(IHubContext <RaffleHub> raffleHub, WinnerService winnerService)
 {
     RaffleHub     = raffleHub;
     WinnerService = winnerService;
 }
Пример #10
0
 public WinnerServiceTests()
 {
     _sut = new WinnerService();
 }
Пример #11
0
 public RaffleHub(WinnerService winnerService)
 {
     WinnerService = winnerService;
 }