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