Example #1
0
 public int GetCharsCount_ParametersAreValid_ReturnsResult(string str, char[] chars, int startIndex, int endIndex)
 {
     // Act
     return(CharsCounter.GetCharsCount(str, chars, startIndex, endIndex));
 }
Example #2
0
 public void GetCharsCountStartIndexEndIndexLimit_StrParameterIsNull_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentNullException>(() => CharsCounter.GetCharsCount(null, null, 0, 0, 0));
 }
Example #3
0
 public void GetCharsCountStartIndexEndIndex_EndIndexGreaterStringLength_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentOutOfRangeException>(() => CharsCounter.GetCharsCount(string.Empty, new char[] { 'a' }, 0, 1));
 }
Example #4
0
 public void GetCharsCountStartIndexEndIndex_StartIndexGreaterEndIndex_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentOutOfRangeException>(() => CharsCounter.GetCharsCount("aa", new char[] { 'a' }, 1, 0));
 }
Example #5
0
 public void GetCharsCountStartIndexEndIndex_StartIndexLessZero_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentOutOfRangeException>(() => CharsCounter.GetCharsCount(string.Empty, new char[] { 'a' }, -1, 0));
 }
Example #6
0
 public void GetCharsCountStartIndexEndIndex_CharsParameterIsNull_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentNullException>(() => CharsCounter.GetCharsCount(string.Empty, null, 0, 0));
 }
Example #7
0
 public int GetCharsCount_ParametersAreValid_ReturnsResult(string str, char[] chars)
 {
     // Act
     return(CharsCounter.GetCharsCount(str, chars));
 }
Example #8
0
 public void GetCharsCountStartIndexEndIndexLimit_LimitLessZero_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentOutOfRangeException>(() => CharsCounter.GetCharsCount("aa", new char[] { 'a' }, 0, 1, -1));
 }
Example #9
0
 public void GetCharsCount_StrParameterIsNull_ThrowsException()
 {
     // Act
     Assert.Throws <ArgumentNullException>(() => CharsCounter.GetCharsCount(null, null));
 }