public void appends_suffix() { var provider = new Provider(); provider.SetName("", "Test", "", "Provider", "III",""); var result = GenerateDirectUrl(provider); Assert.AreEqual("test-provider-iii", result.ToString()); }
public static void CapturePropertiesForAdd(ProviderV2 source, Provider provider) { provider.Npi = (string.IsNullOrEmpty(source.Npi) ? null : (long?)long.Parse(source.Npi, CultureInfo.InvariantCulture)) ?? provider.Npi; provider.SetName(source.NamePrefix, source.FirstName, source.MiddleName, source.LastName, source.NameSuffix, source.AdditionalSuffix); provider.AdditionalInformation = source.AdditionalInformation; provider.SetDateOfBirth(ConvertToNullibleDateTime(source.DateOfBirth, null, "DateOfBirth", provider.FullName)); provider.SetEmail(source.Email); provider.SetFax(source.Fax); provider.SetInPracticeSince(ConvertToNullibleDateTime(source.InPracticeSince, null, "InPracticeSince", provider.FullName)); provider.IsEnabled = ConvertToBool(source.IsEnabled, true, "IsEnabled", provider.FullName); provider.PhilosophyOfCare = source.PhilosophyOfCare; provider.SetPhone(source.Phone); provider.SetWebsite(source.Website); provider.SetAboutMe(source.AboutMe); provider.VideoContent = source.VideoContent; provider.UpdatedDate = DateTime.UtcNow; provider.Keywords = source.Keywords; provider.CustomKeywords = source.CustomKeywords; provider.ExcludedKeywords = source.ExcludedKeywords; provider.ImageUrl = source.ImageUrl; provider.PictureId = ConvertToNullibleInt(source.PictureId, "PictureId", source.LastName); provider.Custom1 = source.Custom1; provider.Custom2 = source.Custom2; provider.Custom3 = source.Custom3; }
public void appends_prefix() { var provider = new Provider(); provider.SetName("Mrs.", "Test", "", "Provider", "",""); var result = GenerateDirectUrl(provider); Assert.AreEqual("mrs-test-provider", result.ToString()); }
public void appends_full_name() { var provider = new Provider(); provider.SetName("Mr", "Test", "T", "Provider", "Jr","PhD"); var result = GenerateDirectUrl(provider); Assert.IsTrue(result.Equals("mr-test-t-provider-jr-phd")); }
public void appends_first_last_middle_name() { var provider = new Provider(); provider.SetName("", "Test", "joe", "Provider", "",""); var result = GenerateDirectUrl(provider); Assert.AreEqual("test-joe-provider", result.ToString()); }
public void appends_primary_specialty() { var provider = new Provider(); provider.SetName("", "Test", "", "Provider", "",""); provider.AddSpecialty(new Specialty() { Name = "Cardiology" }); var result = GenerateDirectUrl(provider); Assert.AreEqual("test-provider-cardiology", result.ToString()); }
public void lowers() { var provider = new Provider(); provider.SetName("Dr.", "Test", "JOE", "Provider", "III", "PhD"); var result = GenerateDirectUrl(provider); Assert.IsTrue(result.ToLowerInvariant().Equals(result, System.StringComparison.Ordinal)); }
public void generates_unique_value_when_provider_has_exsiting_name() { var provider = new Provider(); provider.SetName("Dr.", "John", "E", "Doe", "MD", ""); var directUrl = GenerateDirectUrl(provider); Assert.AreEqual("dr-john-e-doe-md-1", directUrl.ToString()); }
public void strips_invalid_characters() { var invalidChars = @".[{:,&^%$#?~`@!\/]|+=]".ToArray(); var provider = new Provider(); provider.SetName("Dr.", "T.[{:,`@!est", "T&^%$#?~", @"@Provider\/]|+=]", "Jr/#$%.", "PhD/#$%."); var result = GenerateDirectUrl(provider); foreach (var invalidCharacter in invalidChars) { Assert.IsFalse(result.Contains(invalidCharacter)); } }
public void removes_spaces() { var provider = new Provider(); provider.SetName("Dr", "Test", "T", "Two LastNames", "", ""); var directUrl = GenerateDirectUrl(provider); Assert.AreEqual("dr-test-t-two-lastnames", directUrl.ToString()); }
public static Provider Create(string namePrefix, string firstName, string middleName, string lastName, string nameSuffix, string additionalSuffix) { var provider = new Provider(); provider.SetName(namePrefix, firstName, middleName, lastName, nameSuffix, additionalSuffix); return provider; }