public void Constructor_OwnerSetter() { var owner = new NaturalPeople("xyz"); var legalPeople = new LegalPeople("foo", "bar", "xyz", owner); Assert.AreSame(owner, owner); }
public async Task <Guid> Create(NewPDV newPDV) { var owner = new NaturalPeople(newPDV.Owner); var company = new LegalPeople(newPDV.TradingName, newPDV.TradingName, newPDV.Document, owner); var pdv = new PDV(newPDV.Code, company, newPDV.CoverageArea, newPDV.Address); await pdvRepository.Add(pdv); return(pdv.Id); }
public void Constructor_CompanySetter() { var legalPeople = new LegalPeople("foo", "bar", "xyz", new NaturalPeople("xyz")); var coverageArea = GeoJSONFactory.NewMultiPolygon(new double[, ] { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }); var address = GeoJSONFactory.NewPoint(0, 0); var pdv = new PDV("1", legalPeople, coverageArea, address); Assert.AreSame(legalPeople, pdv.Company); }
public PDV(string code, LegalPeople company, GeoJsonMultiPolygon <GeoJson2DCoordinates> coverageArea, GeoJsonPoint <GeoJson2DCoordinates> address) { if (company == null) { throw new ArgumentException("A empresa é necessária."); } if (coverageArea == null) { throw new ArgumentException("A área de cobertura é necessária"); } if (address == null) { throw new ArgumentException("O endereço é necessário."); } Code = code; Id = Guid.NewGuid(); Company = company; CoverageArea = coverageArea; Address = address; }
public void Constructor_DocumentSetter() { var legalPeople = new LegalPeople("foo", "bar", "xyz", new NaturalPeople("xyz")); Assert.AreEqual("xyz", legalPeople.Document); }
public void Constructor_TradingNameSetter() { var legalPeople = new LegalPeople("foo", "bar", "xyz", new NaturalPeople("xyz")); Assert.AreEqual("foo", legalPeople.TradingName); }