/// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="person">osoba</param>
 public PersonSnapshot(Person person)
 {
     this.fullName = person.FullName;
     this.oib = person.Oib;
     this.address = person.Address;
     this.telephoneList = person.Telephones;
 }
 /// <summary>
 /// Konstruktor
 /// </summary>
 public MaintenanceRequest(Person submitter, string subject, string description, string location)
 {
     this.submitter = new PersonSnapshot(submitter);
     this.subject = subject;
     this.description = description;
     this.location = location;
     dateTimeOfRequest = DateTime.Now;
 }
        public static Building getBuilding(Person person)
        {
            Building buildingForMock = new Building(getLandRegistry(), getBuildingManager());
            IList<Building> buildingsForMock = new List<Building>() { buildingForMock };
            Mock<IBuildingsRepository> buildingRepositoryMock = new Mock<IBuildingsRepository>();
            buildingRepositoryMock.Setup(x => x.GetBuildings(person.Oib)).Returns(buildingsForMock);

            return buildingRepositoryMock.Object.GetBuildings(person.Oib)[0];
        }
Esempio n. 4
0
        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="personTo">osoba koja mora platiti</param>
        /// <param name="legalPersonFrom">osoba kojoj se placa</param>
        /// <param name="tax">porez</param>
        public Bill(Person personTo, LegalPerson legalPersonFrom, short tax)
        {
            if(String.IsNullOrEmpty(legalPersonFrom.NumberOfBankAccount)) {
                throw new RulesException("Legal Person has not valid bank account number.");
            }

            To = new PersonSnapshot(personTo);
            From = new LegalPersonSnapshot(legalPersonFrom);
            this.tax = tax;
            isPayed = false;
            dateTimeIssued = DateTime.Now;

            billItems = new List<BillItem>();
        }
        public void SetUp()
        {
            // Dohvacanje osobe iz repozitorija
            person = getPerson();

            // Dohvacanje zgrade za zadanu osobu
            building = getBuilding(person);
        }