public void SearchMaskShouldReturnTheRelatedMask() { PANs newRecord = new PANs(); newRecord.PAN = PAN; newRecord.MaskedPAN = mask; _db.PANs.Add(newRecord); _db.SaveChanges(); _sut.SearchMask(PAN).Should().Be(mask); }
public string SearchMask(string PAN) { PANs PANdata = _db.PANs.SingleOrDefault(x => x.PAN == PAN); if (PANdata != null) { return(PANdata.MaskedPAN.Trim()); } return(null); }
public string SearchPAN(string mask) { PANs PANdata = _db.PANs.SingleOrDefault(x => x.MaskedPAN == mask); if (PANdata != null) { return(PANdata.PAN.Trim()); } return(null); }
public void AddPanAndMask(string PAN, string mask) { PANs NewRecord = new PANs(); if ((SearchMask(PAN) == null) || (SearchPAN(mask) == null)) { NewRecord.PAN = PAN; NewRecord.MaskedPAN = mask; _db.PANs.Add(NewRecord); _db.SaveChanges(); } }