public void Issue960IgnoresEmptyBranchesGeneratedForSwitchExpressions_UnoptimisedCode()
        {
            // arrange
            _mockFilter
            .Setup(x => x.InstrumentClass(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(true);

            var types   = _reader.GetInstrumentableTypes();
            var type    = types.First(x => x.FullName.EndsWith("SwitchExpression"));
            var methods = _reader.GetMethodsForType(type, new File[0]);

            var points = _reader.GetBranchPointsForToken(methods.First(x => x.FullName.Contains("::MapMyTest")).MetadataToken);

            Assert.AreEqual(4, points.Count());
            Assert.AreEqual(6, points.First().Offset);
        }
Beispiel #2
0
        public void GetInstrumentableTypes_Returns_AllTypes_InModule_ThatCanBeInstrumented()
        {
            // arrange
            _mockFilter
            .Setup(x => x.InstrumentClass(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(true);

            // act
            var types = _reader.GetInstrumentableTypes();

            // assert
            Assert.NotNull(types);
            Assert.AreNotEqual(0, types.GetLength(0));
        }