public void SIPProviderNoNameValidationTest() { SIPProvider target = new SIPProvider() { Owner = "owner" }; string validationResult = SIPProvider.Validate(target); Assert.AreEqual("A provider name must be specified.", validationResult); }
[Ignore] // "Haven't been able to get the regex validation to work as yet." public void SIPProviderInvalidusernameValidationTest() { SIPProvider target = new SIPProvider() { Owner = "owner", ProviderUsername = "******", ProviderName = "my.provider" }; string validationResult = SIPProvider.Validate(target); Assert.AreEqual("Provider names cannot contain a full stop '.' in order to avoid ambiguity with DNS host names, please remove the '.'.", validationResult); }
[Ignore] // "Haven't been able to get the regex validation to work as yet." public void SIPProviderInvalidServerValidationTest() { SIPProvider target = new SIPProvider() { Owner = "owner", ProviderName = "test", ProviderUsername = "******", ProviderType = "SIP", ProviderServer = "somehost" }; string validationResult = SIPProvider.Validate(target); Assert.AreEqual("The SIP provider server should contain at least one '.' to be recognised as a valid hostname or IP address.", validationResult); }