Exemplo n.º 1
0
        public PollingStationDO PollingStationGet([PexAssumeUnderTest] VoterDO target)
        {
            PollingStationDO result = target.PollingStation;

            return(result);
            // TODO: add assertions to method VoterDOTest.PollingStationGet(VoterDO)
        }
Exemplo n.º 2
0
        public PollingStationDO Constructor01()
        {
            PollingStationDO target = new PollingStationDO();

            return(target);
            // TODO: add assertions to method PollingStationDOTest.Constructor01()
        }
Exemplo n.º 3
0
        public int GetHashCode01([PexAssumeUnderTest] PollingStationDO target)
        {
            int result = target.GetHashCode();

            return(result);
            // TODO: add assertions to method PollingStationDOTest.GetHashCode01(PollingStationDO)
        }
Exemplo n.º 4
0
        public bool FullyInitialized([PexAssumeUnderTest] PollingStationDO target)
        {
            bool result = target.FullyInitialized();

            return(result);
            // TODO: add assertions to method PollingStationDOTest.FullyInitialized(PollingStationDO)
        }
Exemplo n.º 5
0
        public string ToString01([PexAssumeUnderTest] PollingStationDO target)
        {
            string result = target.ToString();

            return(result);
            // TODO: add assertions to method PollingStationDOTest.ToString01(PollingStationDO)
        }
Exemplo n.º 6
0
        /// <summary>
        /// Fetch data from the db based on the current filter.
        /// </summary>
        public void FetchData()
        {
            pDAO = new PollingStationDAO(DigitalVoterList.GetDefaultInstance());
            mDAO = new MunicipalityDAO(DigitalVoterList.GetDefaultInstance());
            vDAO = new VoterDAO(DigitalVoterList.GetDefaultInstance());

            VoterFilter f = this.Filter;

            if (f.CPRNO != 0)
            {
                this.Voters = vDAO.Read(v => v.PrimaryKey == f.CPRNO);
                VoterDO voter = this.Voters.First();
                this.PollingStations = pDAO.Read(ps => ps.PrimaryKey == voter.PollingStationId);
                PollingStationDO pollingStation = this.PollingStations.First();
                this.Municipalities = mDAO.Read(m => m.PrimaryKey == pollingStation.MunicipalityId);
            }
            else if (f.PollingStation != null)
            {
                this.PollingStations = pDAO.Read(ps => ps.PrimaryKey == f.PollingStation.PrimaryKey);
                this.Voters = vDAO.Read(v => v.PollingStationId == f.PollingStation.PrimaryKey);
                this.Municipalities = mDAO.Read(m => m.PrimaryKey == f.PollingStation.MunicipalityId);
            }
            else if (f.Municipality != null)
            {
                this.Municipalities = mDAO.Read(m => m.PrimaryKey == f.Municipality.PrimaryKey);
                this.PollingStations = pDAO.Read(p => p.MunicipalityId == f.Municipality.PrimaryKey);

                this.Voters = Enumerable.Empty<VoterDO>();
                foreach (var ps in this.PollingStations)
                {
                    PollingStationDO ps1 = ps;
                    this.Voters = this.Voters.Concat(vDAO.Read(v => v.PollingStationId == ps1.PrimaryKey));
                }
            }
        }
Exemplo n.º 7
0
        public MunicipalityDO MunicipalityGet([PexAssumeUnderTest] PollingStationDO target)
        {
            MunicipalityDO result = target.Municipality;

            return(result);
            // TODO: add assertions to method PollingStationDOTest.MunicipalityGet(PollingStationDO)
        }
Exemplo n.º 8
0
        public ICollection <VoterDO> VotersGet([PexAssumeUnderTest] PollingStationDO target)
        {
            ICollection <VoterDO> result = target.Voters;

            return(result);
            // TODO: add assertions to method PollingStationDOTest.VotersGet(PollingStationDO)
        }
Exemplo n.º 9
0
        public bool Equals01([PexAssumeUnderTest] PollingStationDO target, object obj)
        {
            bool result = target.Equals(obj);

            return(result);
            // TODO: add assertions to method PollingStationDOTest.Equals01(PollingStationDO, Object)
        }
Exemplo n.º 10
0
 public PollingStationDO Constructor(
     uint? municipalityId,
     uint? id,
     string name,
     string address
 )
 {
     PollingStationDO target = new PollingStationDO(municipalityId, id, name, address);
     return target;
     // TODO: add assertions to method PollingStationDOTest.Constructor(Nullable`1<UInt32>, Nullable`1<UInt32>, String, String)
 }
Exemplo n.º 11
0
        public PollingStationDO Constructor(
            uint?municipalityId,
            uint?id,
            string name,
            string address
            )
        {
            PollingStationDO target = new PollingStationDO(municipalityId, id, name, address);

            return(target);
            // TODO: add assertions to method PollingStationDOTest.Constructor(Nullable`1<UInt32>, Nullable`1<UInt32>, String, String)
        }
 public void UpdateValues7102()
 {
     PollingStationDO pollingStationDO;
     pollingStationDO =
       new PollingStationDO(default(uint?), default(uint?), "", (string)null);
     this.UpdateValues(pollingStationDO, (IDataObject)pollingStationDO);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>("", pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
Exemplo n.º 13
0
        /// <summary>
        /// React to polling station filter selection.
        /// </summary>
        /// <param name="changedTo">The polling station that has been selected.</param>
        public void PSSelectionChanged(object changedTo)
        {
            this.view.ResetCPRText();

            PollingStationDO p      = changedTo as PollingStationDO;
            VoterFilter      filter = new VoterFilter(p.Municipality, p);

            this.view.DisablePSSelectionHandlers();

            this.mainModel.ReplaceFilter(filter);

            this.view.EnablePSSelectionHandlers();
        }
 public void ResetAssociations273()
 {
     PollingStationDO pollingStationDO;
     pollingStationDO = new PollingStationDO
                    (default(uint?), default(uint?), (string)null, (string)null);
     this.ResetAssociations(pollingStationDO);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>((string)null, pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
Exemplo n.º 15
0
        public void ResetAssociations273()
        {
            PollingStationDO pollingStationDO;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            this.ResetAssociations(pollingStationDO);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 16
0
        public void UpdateValues71()
        {
            PollingStationDO pollingStationDO;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            this.UpdateValues(pollingStationDO, (IDataObject)pollingStationDO);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 17
0
        public void GeneratePollingStations(int stations, int municipalities)
        {
            var p = new HashSet<PollingStationDO>();

            for (uint i = 0; i < stations; i++)
            {
                var pollingstation = new PollingStationDO(
                    (uint?)this.r.Next(municipalities), i, this.data.GetStationName(), this.data.GetRoadname() + " " + this.r.Next(1000));

                p.Add(pollingstation);
            }
            var dao = new PollingStationDAO(dvl);
            dao.Create(p);
        }
 public void Equals01665()
 {
     PollingStationDO pollingStationDO;
     bool b;
     pollingStationDO = new PollingStationDO
                    (default(uint?), default(uint?), (string)null, (string)null);
     b = this.Equals01(pollingStationDO, (object)null);
     Assert.AreEqual<bool>(false, b);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>((string)null, pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
 public void FullyInitialized98001()
 {
     PollingStationDO pollingStationDO;
     bool b;
     pollingStationDO =
       new PollingStationDO(default(uint?), default(uint?), (string)null, "");
     b = this.FullyInitialized(pollingStationDO);
     Assert.AreEqual<bool>(false, b);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>((string)null, pollingStationDO.Name);
     Assert.AreEqual<string>("", pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
 public void ToString0148201()
 {
     PollingStationDO pollingStationDO;
     string s;
     pollingStationDO =
       new PollingStationDO(default(uint?), default(uint?), "", (string)null);
     s = this.ToString01(pollingStationDO);
     Assert.AreEqual<string>("", s);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>("", pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
Exemplo n.º 21
0
        public void GeneratePollingStations(int stations, int municipalities)
        {
            var p = new HashSet <PollingStationDO>();

            for (uint i = 0; i < stations; i++)
            {
                var pollingstation = new PollingStationDO(
                    (uint?)this.r.Next(municipalities), i, this.data.GetStationName(), this.data.GetRoadname() + " " + this.r.Next(1000));

                p.Add(pollingstation);
            }
            var dao = new PollingStationDAO(dvl);

            dao.Create(p);
        }
 public void MunicipalityGet637()
 {
     PollingStationDO pollingStationDO;
     MunicipalityDO municipalityDO;
     pollingStationDO = new PollingStationDO
                    (default(uint?), default(uint?), (string)null, (string)null);
     municipalityDO = this.MunicipalityGet(pollingStationDO);
     Assert.IsNull((object)municipalityDO);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>((string)null, pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
 }
Exemplo n.º 23
0
        public void ToString01482()
        {
            PollingStationDO pollingStationDO;
            string           s;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            s = this.ToString01(pollingStationDO);
            Assert.AreEqual <string>("", s);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 24
0
        public void GetHashCode01402()
        {
            PollingStationDO pollingStationDO;
            int i;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            i = this.GetHashCode01(pollingStationDO);
            Assert.AreEqual <int>(0, i);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 25
0
        public void MunicipalityGet637()
        {
            PollingStationDO pollingStationDO;
            MunicipalityDO   municipalityDO;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            municipalityDO = this.MunicipalityGet(pollingStationDO);
            Assert.IsNull((object)municipalityDO);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 26
0
        public void Equals01665()
        {
            PollingStationDO pollingStationDO;
            bool             b;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            b = this.Equals01(pollingStationDO, (object)null);
            Assert.AreEqual <bool>(false, b);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
Exemplo n.º 27
0
        public void FullyInitialized98001()
        {
            PollingStationDO pollingStationDO;
            bool             b;

            pollingStationDO =
                new PollingStationDO(default(uint?), default(uint?), (string)null, "");
            b = this.FullyInitialized(pollingStationDO);
            Assert.AreEqual <bool>(false, b);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>("", pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
        }
 public void VotersGet673()
 {
     PollingStationDO pollingStationDO;
     ICollection<VoterDO> iCollection;
     pollingStationDO = new PollingStationDO
                    (default(uint?), default(uint?), (string)null, (string)null);
     iCollection = this.VotersGet(pollingStationDO);
     Assert.IsNotNull((object)iCollection);
     Assert.IsNotNull((object)pollingStationDO);
     Assert.IsNull((object)(pollingStationDO.PrimaryKey));
     Assert.IsNull((object)(pollingStationDO.MunicipalityId));
     Assert.AreEqual<string>((string)null, pollingStationDO.Name);
     Assert.AreEqual<string>((string)null, pollingStationDO.Address);
     Assert.IsNotNull(pollingStationDO.Voters);
     Assert.IsTrue
     (object.ReferenceEquals(pollingStationDO.Voters, (object)iCollection));
 }
Exemplo n.º 29
0
        public void VotersGet673()
        {
            PollingStationDO      pollingStationDO;
            ICollection <VoterDO> iCollection;

            pollingStationDO = new PollingStationDO
                                   (default(uint?), default(uint?), (string)null, (string)null);
            iCollection = this.VotersGet(pollingStationDO);
            Assert.IsNotNull((object)iCollection);
            Assert.IsNotNull((object)pollingStationDO);
            Assert.IsNull((object)(pollingStationDO.PrimaryKey));
            Assert.IsNull((object)(pollingStationDO.MunicipalityId));
            Assert.AreEqual <string>((string)null, pollingStationDO.Name);
            Assert.AreEqual <string>((string)null, pollingStationDO.Address);
            Assert.IsNotNull(pollingStationDO.Voters);
            Assert.IsTrue
                (object.ReferenceEquals(pollingStationDO.Voters, (object)iCollection));
        }
Exemplo n.º 30
0
 public void UpdateValuesThrowsContractException717()
 {
     try
     {
         PollingStationDO pollingStationDO;
         pollingStationDO = new PollingStationDO
                                (default(uint?), default(uint?), (string)null, (string)null);
         this.UpdateValues(pollingStationDO, (IDataObject)null);
         throw
             new AssertFailedException("expected an exception of type ContractException");
     }
     catch (Exception ex)
     {
         if (!PexContract.IsContractException(ex))
         {
             throw ex;
         }
     }
 }
Exemplo n.º 31
0
        public void ReadOperation3()
        {
            // Arrange
            var pdao = new PollingStationDAO();
            PollingStationDO pollingStation = pdao.Read(p => true).First();
            // Pick a random polling station.

            var dao = new VoterDAO();

            // Act
            Expression <Func <VoterDO, bool> > f = v => v.PollingStationId == pollingStation.PrimaryKey;
            Func <VoterDO, bool> func            = f.Compile();
            var result = dao.Read(f);

            Debug.Assert(result.Count() > 0, "No voters matched the arranged query, please generate some new data!");
            // The above is very unlikely to fail since we are generating 5000 voters, and the generator only has 50 names to choose from, but we still have to check it.

            // Assert
            foreach (VoterDO voter in result)
            {
                Debug.Assert(func.Invoke(voter));
            }
        }
Exemplo n.º 32
0
 public void UpdateValuesThrowsContractException327()
 {
     try
     {
         VoterDO          voterDO;
         PollingStationDO pollingStationDO;
         voterDO = PexInvariant.CreateInstance <VoterDO>();
         PexInvariant.SetField <uint?>((object)voterDO, "primaryKey", default(uint?));
         PexInvariant.SetField <EntityRef <PollingStationDO> >
             ((object)voterDO, "_pollingStation", default(EntityRef <PollingStationDO>));
         PexInvariant.SetField <uint?>
             ((object)voterDO, "<PollingStationId>k__BackingField", default(uint?));
         PexInvariant.SetField <string>
             ((object)voterDO, "<Name>k__BackingField", (string)null);
         PexInvariant.SetField <string>
             ((object)voterDO, "<Address>k__BackingField", (string)null);
         PexInvariant.SetField <string>
             ((object)voterDO, "<City>k__BackingField", (string)null);
         PexInvariant.SetField <bool?>
             ((object)voterDO, "<CardPrinted>k__BackingField", new bool?(true));
         PexInvariant.SetField <bool?>
             ((object)voterDO, "<Voted>k__BackingField", new bool?(true));
         PexInvariant.CheckInvariant((object)voterDO);
         pollingStationDO = new PollingStationDO
                                (default(uint?), default(uint?), (string)null, (string)null);
         this.UpdateValues(voterDO, (IDataObject)pollingStationDO);
         throw
             new AssertFailedException("expected an exception of type ContractException");
     }
     catch (Exception ex)
     {
         if (!PexContract.IsContractException(ex))
         {
             throw ex;
         }
     }
 }
 public void UpdateValuesThrowsContractException717()
 {
     try
     {
       PollingStationDO pollingStationDO;
       pollingStationDO = new PollingStationDO
                      (default(uint?), default(uint?), (string)null, (string)null);
       this.UpdateValues(pollingStationDO, (IDataObject)null);
       throw
     new AssertFailedException("expected an exception of type ContractException");
     }
     catch(Exception ex)
     {
       if (!PexContract.IsContractException(ex))
     throw ex;
     }
 }
Exemplo n.º 34
0
 public void UpdateValues([PexAssumeUnderTest] PollingStationDO target, IDataObject dummy)
 {
     target.UpdateValues(dummy);
     // TODO: add assertions to method PollingStationDOTest.UpdateValues(PollingStationDO, IDataObject)
 }
Exemplo n.º 35
0
 public void ResetAssociations([PexAssumeUnderTest] PollingStationDO target)
 {
     target.ResetAssociations();
     // TODO: add assertions to method PollingStationDOTest.ResetAssociations(PollingStationDO)
 }
Exemplo n.º 36
0
        /// <summary>
        /// Populate a voter card with the information of a given voter.
        /// </summary>
        /// <param name="page">The page containing the card.</param>
        /// <param name="pdf">The pdf containing the page.</param>
        /// <param name="xO">The horizontal offset of the card in points.</param>
        /// <param name="yO">The vertical offset of the card in points.</param>
        /// <param name="voter">The voter whose information to be populated onto the card.</param>
        private static void PopulateCard(Page page, PDF pdf, double xO, double yO, VoterDO voter)
        {
            // ----- POPULATE: POLLING STATION -----
            PollingStationDO ps = voter.PollingStation;

            var font = new Font(pdf, CoreFont.HELVETICA);

            font.SetSize(9);

            var t = new TextLine(font, ps.Name);

            t.SetPosition(xO + 9 * U, yO + 27.5 * U);
            t.DrawOn(page);

            t = new TextLine(font, ps.Address);
            t.SetPosition(xO + 9 * U, yO + 32 * U);
            t.DrawOn(page);

            t = new TextLine(font, "valgfrit");
            t.SetPosition(xO + 29 * U, yO + 48.8 * U);
            t.DrawOn(page);

            t = new TextLine(font, "02-04861");
            t.SetPosition(xO + 29 * U, yO + 58.7 * U);
            t.DrawOn(page);

            t = new TextLine(font, "09:00 - 20:00");
            t.SetPosition(xO + 29 * U, yO + 68.2 * U);
            t.DrawOn(page);


            // ----- POPULATE: VOTER -----
            MunicipalityDO mun = voter.PollingStation.Municipality;

            font = new Font(pdf, CoreFont.COURIER);
            font.SetSize(10);

            // Add top voter number 'Vælgernr.'
            t = new TextLine(font, "02-04861");
            t.SetPosition(xO + 102 * U, yO + 12 * U);
            t.DrawOn(page);

            // Add sender 'Afsender'
            t = new TextLine(font, mun.Name);
            t.SetPosition(xO + 102 * U, yO + 32.5 * U);
            t.DrawOn(page);

            t = new TextLine(font, mun.Address);
            t.SetPosition(xO + 102 * U, yO + 36.5 * U);
            t.DrawOn(page);

            t = new TextLine(font, mun.City);
            t.SetPosition(xO + 102 * U, yO + 40.5 * U);
            t.DrawOn(page);

            // Add reciever 'Modtager'
            t = new TextLine(font, voter.Name);
            t.SetPosition(xO + 102 * U, yO + 62.5 * U);
            t.DrawOn(page);

            t = new TextLine(font, voter.Address);
            t.SetPosition(xO + 102 * U, yO + 66.5 * U);
            t.DrawOn(page);

            t = new TextLine(font, voter.City);
            t.SetPosition(xO + 102 * U, yO + 70.5 * U);
            t.DrawOn(page);

            // Add CPR barcode
            string barcode = BarCodeHashing.Hash(voter.PrimaryKey.Value).ToString();
            var    b       = new BarCode(BarCode.CODE128, barcode);

            b.SetPosition(xO + 160 * U, yO + 60 * U);
            b.DrawOn(page);

            t = new TextLine(font, barcode);
            t.SetPosition(xO + 160 * U, yO + 72 * U);
            t.DrawOn(page);
        }
Exemplo n.º 37
0
 public PollingStationDO Constructor01()
 {
     PollingStationDO target = new PollingStationDO();
     return target;
     // TODO: add assertions to method PollingStationDOTest.Constructor01()
 }
 public void UpdateValuesThrowsContractException327()
 {
     try
     {
       VoterDO voterDO;
       PollingStationDO pollingStationDO;
       voterDO = PexInvariant.CreateInstance<VoterDO>();
       PexInvariant.SetField<uint?>((object)voterDO, "primaryKey", default(uint?));
       PexInvariant.SetField<EntityRef<PollingStationDO>>
       ((object)voterDO, "_pollingStation", default(EntityRef<PollingStationDO>));
       PexInvariant.SetField<uint?>
       ((object)voterDO, "<PollingStationId>k__BackingField", default(uint?));
       PexInvariant.SetField<string>
       ((object)voterDO, "<Name>k__BackingField", (string)null);
       PexInvariant.SetField<string>
       ((object)voterDO, "<Address>k__BackingField", (string)null);
       PexInvariant.SetField<string>
       ((object)voterDO, "<City>k__BackingField", (string)null);
       PexInvariant.SetField<bool?>
       ((object)voterDO, "<CardPrinted>k__BackingField", new bool?(true));
       PexInvariant.SetField<bool?>
       ((object)voterDO, "<Voted>k__BackingField", new bool?(true));
       PexInvariant.CheckInvariant((object)voterDO);
       pollingStationDO = new PollingStationDO
                      (default(uint?), default(uint?), (string)null, (string)null);
       this.UpdateValues(voterDO, (IDataObject)pollingStationDO);
       throw
     new AssertFailedException("expected an exception of type ContractException");
     }
     catch(Exception ex)
     {
       if (!PexContract.IsContractException(ex))
     throw ex;
     }
 }
Exemplo n.º 39
0
 /// <summary> Initializes a new instance of the <see cref="VoterFilter"/> class. </summary>
 /// <param name="municipality"> The selected municipality (null means not selected).</param>
 /// <param name="pollingStation"> The Selected polling station (null means not selected). </param>
 /// <param name="cprno"> The selected CPR number (0 means not selected). </param>
 public VoterFilter(MunicipalityDO municipality = null, PollingStationDO pollingStation = null, int cprno = 0)
 {
     this.Municipality   = municipality;
     this.PollingStation = pollingStation;
     this.CPRNO          = cprno;
 }
Exemplo n.º 40
0
 /// <summary> Make this polling station the selected polling station. </summary>
 /// <param name="pollingStation">The polling station to be selected.</param>
 public void UpdateSelectedPollingStation(PollingStationDO pollingStation)
 {
     this.cbxPollingStation.SelectedIndex = this.cbxPollingStation.Items.IndexOf(pollingStation);
 }