Exemplo n.º 1
0
        public void ShouldGetProperConstituenciesCount()
        {
            //Given
            IDataRepository repository = _ioc.Resolve <IDataRepository>();

            repository.Add(new CandidatesModel()
            {
                Id = 1, Name = "Adam Kowalski"
            });
            repository.Add(new ConstituencyModel()
            {
                Id   = 1,
                Name = "Okreg 1",
            });
            repository.Add(new ConstituencyModel()
            {
                Id   = 2,
                Name = "Okreg 2",
            });
            var expectedConstituencyList = 2;
            //When
            var constituencies = _votingService.GetConstituencies().ToArray();

            //Then
            Assert.AreEqual(expectedConstituencyList, constituencies.Length);
        }
Exemplo n.º 2
0
 public IEnumerable <Constituency> GetConstituencies()
 {
     return(_votingService.GetConstituencies());
 }