public void GetNonIntegerValuesInMixedTypeArray() { var results = StringArrayMixedTypesIntegers.GetNonIntegerIndexes(); var expectedIndices = new[] { 1, 2, 4, 5, 6, 7 }; Assert.IsTrue(expectedIndices.SequenceEqual(results)); }
public void StringToNullableInteger_Successful() { int[] expected = { 2, 6, -1 }; var nullableResults = StringArrayMixedTypesIntegers.Where(item => item.ToNullable <int>().HasValue) // ReSharper disable once PossibleInvalidOperationException .Select(item => item.ToNullable <int>().Value).ToList(); Assert.IsTrue(nullableResults.SequenceEqual(expected)); }
public void NotAllElementsCanBeConvertedPreserveArray_Integer() { var results = StringArrayMixedTypesIntegers.ToIntegerPreserveArray(); var expectedCount = 9; // expected count Assert.AreEqual(results.Count(), expectedCount, $"Expected only {expectedCount} elements could be converted"); // check if values are as expected Assert.IsTrue(IntegerArrayValidator.SequenceEqual(results)); }