This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class dlkfjslkjd | |
| { | |
| public static IAnyCallConfigurationWithNoReturnTypeSpecified AnyCall<T>(this IFakeOptionsBuilder<T> options) | |
| { | |
| var result = new Callback(); | |
| options.OnFakeCreated(x => result.Apply(A.CallTo(x))); | |
| return result; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This example illustrates why having FakeItEasy default to comparing sequence equivalence for | |
| // enumerable types would be non intuitive. | |
| // In this example the current implementation of FakeItEasy argument constraints would make the | |
| // assertion (MustHaveHappened) fail, which is correct. An implementation where sequence equivalence | |
| // would be used for the constraint the assertion would incorrectly pass. | |
| class Program | |
| { | |
| public interface IPersonRepository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void Should_dispose_request_when_being_disposed() | |
| { | |
| // Given | |
| var request = A.Fake<Request>(x => x.WithArgumentsForConstructor(new[] {"GET", "/", "http"})); | |
| this.context.Request = request; | |
| // When | |
| this.context.Dispose(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //console = undefined; | |
| (function(undefined) { | |
| var log = (function() { | |
| var inner = function(value) { | |
| if (console != undefined && console.log != undefined) { | |
| inner = function(value) { | |
| console.log(value); | |
| }; | |
| } else { | |
| inner = function(value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Foo | |
| { | |
| public void DoWhatever() | |
| { | |
| var user = this.FetchUserFromRepository("userid"); | |
| this.DoSomethingWithTheUser(user); | |
| } | |
| protected virtual object FetchUserFromRepository(string userid) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface IRobot | |
| { | |
| string Name { get; set; } | |
| } | |
| public class RoboCop | |
| : IRobot | |
| { | |
| private readonly IRobot robot; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fake.GetCalls(_log). | |
| Single(call => call.Method.Name == "set_Offset"). | |
| GetArgument<TimeSpan>(0). | |
| Should().Equal(newOffset); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This example illustrates why having FakeItEasy default to comparing sequence equivalence for | |
| // enumerable types would be non intuitive. | |
| // In this example the current implementation of FakeItEasy argument constraints would make the | |
| // assertion (MustHaveHappened) fail, which is correct. An implementation where sequence equivalence | |
| // would be used for the constraint the assertion would incorrectly pass. | |
| class Program | |
| { | |
| public interface IPersonRepository |