コード例 #1
0
        public void OddOrPos_ShouldThrowException_WhenInputNull(int[] data)
        {
            //Arrange
            int result;

            //Act


            //Assert
            Assert.ThrowsException <NullReferenceException>(() => result = SUT.OddOrPos(data));
        }
コード例 #2
0
        [DataRow(new int[] { -1, 2, -3 }, 3)] // fails pre-correction
        public void OddOrPos_ShouldReturnCorrectValue_WhenInputCorrect(int[] data, int expected)
        {
            //Arrange
            int result;

            //Act
            result = SUT.OddOrPos(data);

            //Assert
            expected.Should().Be(result);
        }