public void GetPANShouldReturnPANFromMask(string mask, string expectedPAN) { _panArchiveManager.SearchPAN(mask).Returns(expectedPAN); var sut = new PANserver(_panArchiveManager, _maskGen); string actualPAN = sut.GetPAN(mask); actualPAN.Should().Be(expectedPAN); }
//public bool GivenPANAlredyExists(string inputPAN) //{ // var reader = new StreamReader(fileName); // bool exists = false; // while ((!reader.EndOfStream)&&(exists == false)) // { // string currentPAN = reader.ReadLine(); // exists = (currentPAN.Substring(0, 16) == inputPAN); // } // reader.Close(); // return exists; //} public string GetPAN(string mask) { if (mask.Length != 16) { return(invalidMaskErrorMSG); } else { return(_panArchiveManager.SearchPAN(mask)); } }