public void Should_Construct_NegotiationType() { NegotiationType negotiationType = new NegotiationType(id, name); _ = new NegotiationType(); _ = negotiationType.NegotiationTypeId; _ = negotiationType.Name; negotiationType.ShouldNotBeNull(); }
private static NegotiationDto ParseNegotiationLine(string negotiation, NegotiationType nt, SinacorNoteDto sn) { ; var ret = new NegotiationDto(); try { var negotiantionStrList = JoinCompanyName(negotiation).Split(' ').ToList(); negotiantionStrList.RemoveAll(n => string.IsNullOrWhiteSpace(n)); //Removing last ocurrency string Buy(D) Sell (C) that wasnt removed on outside split var lastElement = negotiantionStrList.ElementAt(negotiantionStrList.Count - 1); if (lastElement.Last().Equals('D') || lastElement.Last().Equals('C')) { negotiantionStrList.RemoveAt(negotiantionStrList.Count - 1); } //Removing column Prazo if (negotiantionStrList.Count() == 11) { negotiantionStrList.RemoveAt(3); } //Removing column Obs. (*) if (negotiantionStrList.Count() == 10) { negotiantionStrList.RemoveAt(6); } ret = new NegotiationDto(); ret.SinacorNoteId = sn.Id; ret.Stock = negotiantionStrList.ElementAt(3); ret.NegotiationType = nt; ret.Amount = int.Parse(negotiantionStrList.ElementAt(4)); ret.UnitaryPrice = decimal.Parse(negotiantionStrList.ElementAt(5)); ret.TotalPrice = decimal.Parse(negotiantionStrList.ElementAt(6)); } catch (Exception ex) { throw; } return(ret); }