public void InsertNumberTest() { int expected = 345346; int result = NumbersExtension.InsertNumberIntoAnother(-55465467, 345346, 0, 31); Assert.AreEqual(expected, result); }
public void InsertNumberIntoAnotherWith14_50_Return_22() { int sourceNumber = 14; int numberln = 50; int i = 3; int j = 6; int expected = 22; int actual = NumbersExtension.InsertNumberIntoAnother(sourceNumber, numberln, i, j); Assert.AreEqual(expected, actual); }
public void InsertNumberIntoAnotherWithBigNumbers() { int sourceNumber = 554216104; int numberln = 4460559; int i = 11; int j = 18; int expected = 554203816; int actual = NumbersExtension.InsertNumberIntoAnother(sourceNumber, numberln, i, j); Assert.AreEqual(expected, actual); }
public void InsertNumberIntoAnotherTest_TestData_ExpectedNumber() { int numberSource = Convert.ToInt32(TestContext.DataRow["numberSource"]); int numberIn = Convert.ToInt32(TestContext.DataRow["numberIn"]); int i = Convert.ToInt32(TestContext.DataRow["i"]); int j = Convert.ToInt32(TestContext.DataRow["j"]); int expected = Convert.ToInt32(TestContext.DataRow["expectedNumber"]); var actual = NumbersExtension.InsertNumberIntoAnother(numberSource, numberIn, i, j); Assert.AreEqual(actual, expected); }
public void InsertNumberIntoAnother_IOrJLessThan0_ArgumentOutOfRangeException() { Assert.ThrowsException <ArgumentOutOfRangeException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, -1, 3)); Assert.ThrowsException <ArgumentOutOfRangeException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, 32, 32)); Assert.ThrowsException <ArgumentOutOfRangeException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, 0, 32)); }
public void InsertNumberIntoAnother_ILargerThanJ_ArgumentException() { Assert.ThrowsException <ArgumentException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, 8, 3)); }
public int InsertNumberIntoAnotherTest(int numberSource, int numberIn, int i, int j, int expected) { return(NumbersExtension.InsertNumberIntoAnother(numberSource, numberIn, i, j)); }
public void SInsertNumberIntoAnother_Throw_ArgumentException() { Assert.ThrowsException <ArgumentException>(() => NumbersExtension.InsertNumberIntoAnother(10, 45, 23, 12), message: "Method generates ArgumentException in case i more then j"); }
public void InsertNumberIntoAnother_ArgumentOutOfRangeException_MoreAndLess() => Assert.Throws <ArgumentOutOfRangeException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, 0, 32), message: "index must be less then 32");
public void InsertNumberIntoAnother_ArgumentOutOfRangeException_Less() => Assert.Throws <ArgumentOutOfRangeException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, -1, 3), message: "index must be positive");
public void InsertNumberIntoAnother_ArgumentException() => Assert.Throws <ArgumentException>(() => NumbersExtension.InsertNumberIntoAnother(8, 15, 8, 3), message: "i must be less then j");
public int InsertNumbers_SomeNumbers_ExpectedResult(int numberSource, int numberIn, int i, int j) { return(NumbersExtension.InsertNumberIntoAnother(numberSource, numberIn, i, j)); }