コード例 #1
0
        public void ShouldAnalyzeSphereCovering()
        {
            // Given
            var g11 = new G11GolayCode();

            // When
            var actualMinimalRadius = _analyzer.Analyze(g11);

            // Then
            const int expectedMinimalRadius = 2;

            Assert.Equal(expectedMinimalRadius, actualMinimalRadius);

            _mockLogger.Verify(
                x => x.Log(
                    It.Is <LogLevel>(l => l == LogLevel.Information),
                    It.IsAny <EventId>(),
                    It.IsAny <object>(),
                    It.IsAny <Exception>(),
                    It.IsAny <Func <object, Exception, string> >()
                    ),
                Times.AtLeastOnce()
                );
        }
コード例 #2
0
 private static void AnalyzeMinimalSphereCovering(ICode code)
 {
     Logger.LogInformation("Minimal radius: {minimalRadius}", MinimalSphereCoveringAnalyzer.Analyze(code));
 }