protected override void Act()
            {
                actualSomethingProvider = container.Resolve <ISomethingProvider>();
                actualLinkedTypes       = new HashSet <string>();

                // Execute requests, with the 3rd one unhandled
                actualCall1Result = actualSomethingProvider.GetSomething(
                    1,
                    11,
                    "",
                    DateTime.Now,
                    0,
                    0,
                    actualLinkedTypes);

                actualCall2Result = actualSomethingProvider.GetSomething(
                    2,
                    22,
                    "",
                    DateTime.Now,
                    0,
                    0,
                    actualLinkedTypes);

                try
                {
                    actualSomethingProvider.GetSomething(3, 33, "", DateTime.Now, 0, 0, actualLinkedTypes);
                }
                catch (Exception ex)
                {
                    actualExceptionCall3 = ex;
                }
            }
Ejemplo n.º 2
0
        public void MockMethod()
        {
            // Given
            _somethingProvider.GetSomething().Returns("hello_method_call");

            // When
            var result = _somethingProvider.GetSomething();

            // Then
            result.Should().Be("hello_method_call");
            _somethingProvider.Received().GetSomething();
        }