GivenInvalidEmailStrengthRegularExpressionConfigWhenemailStrengthRegularExpressionThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "emailStrengthRegularExpression", "(.*" } }; // act // asert Assert.Throws <ProviderException>(() => testClass.Initialize("name", config)); }
public void GivenEmptyMaxPasswordLengthConfigWhenMaxPasswordLengthThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "maxPasswordLength", string.Empty } }; testClass.Initialize("name", config); // act var result = testClass.MaxPasswordLength; // assert Assert.That(result, Is.EqualTo(128)); }
GivenEmptyEmailStrengthRegularExpressionConfigWhenemailStrengthRegularExpressionThenEmptytValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "emailStrengthRegularExpression", string.Empty } }; testClass.Initialize("name", config); // act var result = testClass.EmailStrengthRegularExpression; // assert Assert.That(result, Is.EqualTo(string.Empty)); }
GivenNoMinRequiredPasswordLengthConfigWhenMinRequiredNonalphanumericCharactersThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection(); testClass.Initialize("name", config); // act var result = testClass.MinRequiredPasswordLength; // assert Assert.That(result, Is.EqualTo(1)); }
public void GivenEmptyMaxUserNameLengthConfigWhenMaxUserNameLengthThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "maxUserNameLength", string.Empty } }; testClass.Initialize("name", config); // act var result = testClass.MaxUserNameLength; // assert Assert.That(result, Is.EqualTo(56)); }
GivenEmptyEmailStrengthRegularExpressionConfigWhenemailStrengthRegularExpressionThenEmptytValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "emailStrengthRegularExpression", string.Empty } }; testClass.Initialize("name", config); // act var result = testClass.EmailStrengthRegularExpression; // assert Assert.That(result, Is.EqualTo(string.Empty)); }
public void GivenMinRequiredPasswordLengthConfigWhenMinRequiredPasswordLengthThenCorrectValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "minRequiredPasswordLength", "2" } }; testClass.Initialize("name", config); // act var result = testClass.MinRequiredPasswordLength; // assert Assert.That(result, Is.EqualTo(2)); }
GivenMinRequiredNonalphanumericCharactersConfigWhenMinRequiredNonalphanumericCharactersThenCorrectValueReturned() { // arrange var testClass = new MoqAutoMocker <BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "minRequiredNonalphanumericCharacters", "2" } }; testClass.Initialize("name", config); // act var result = testClass.MinRequiredNonAlphanumericCharacters; // assert Assert.That(result, Is.EqualTo(2)); }
GivenInvalidEmailStrengthRegularExpressionConfigWhenemailStrengthRegularExpressionThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "emailStrengthRegularExpression", "(.*" } }; // act // asert Assert.Throws<ProviderException>(() => testClass.Initialize("name", config)); }
GivenNoMinRequiredPasswordLengthConfigWhenMinRequiredNonalphanumericCharactersThenDefaultValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection(); testClass.Initialize("name", config); // act var result = testClass.MinRequiredPasswordLength; // assert Assert.That(result, Is.EqualTo(1)); }
public void GivenMinRequiredPasswordLengthConfigWhenMinRequiredPasswordLengthThenCorrectValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "minRequiredPasswordLength", "2" } }; testClass.Initialize("name", config); // act var result = testClass.MinRequiredPasswordLength; // assert Assert.That(result, Is.EqualTo(2)); }
GivenMinRequiredNonalphanumericCharactersConfigWhenMinRequiredNonalphanumericCharactersThenCorrectValueReturned() { // arrange var testClass = new MoqAutoMocker<BetterMembershipProvider>().ClassUnderTest; var config = new NameValueCollection { { "minRequiredNonalphanumericCharacters", "2" } }; testClass.Initialize("name", config); // act var result = testClass.MinRequiredNonAlphanumericCharacters; // assert Assert.That(result, Is.EqualTo(2)); }