Example #1
0
        public static void UnconfiguredAsyncMethod(
            IFooBarService fake,
            Task task)
        {
            "Given a fake"
            .x(() => fake = A.Fake <IFooBarService>());

            "When calling an unconfigured async method with no result"
            .x(() => task = fake.CommandAsync());

            "Then it should return a completed task"
            .x(() => task.IsCompleted.Should().BeTrue());
        }
Example #2
0
        public static void UnconfiguredAsyncMethod(
            IFooBarService fake,
            Task task)
        {
            "Given a fake"
                .x(() => fake = A.Fake<IFooBarService>());

            "When calling an unconfigured async method with no result"
                .x(() => task = fake.CommandAsync());

            "Then it should return a completed task"
                .x(() => task.IsCompleted.Should().BeTrue());
        }
Example #3
0
        public static void UnconfiguredAsyncMethodReturnValueOfNonDummyableType(
            IFooBarService fake,
            Task <Bar> task)
        {
            "Given a fake"
            .x(() => fake = A.Fake <IFooBarService>());

            "When calling an unconfigured async method with a result of a non-dummyable type"
            .x(() => task = fake.GetBarAsync());

            "Then it should return a completed task"
            .x(() => task.IsCompleted.Should().BeTrue());

            "And the task's result should be null"
            .x(() => task.Result.Should().BeNull());
        }
Example #4
0
        public static void UnconfiguredAsyncMethodWithReturnValueOfTypeInt(
            IFooBarService fake,
            Task <int> task)
        {
            "Given a fake"
            .x(() => fake = A.Fake <IFooBarService>());

            "When calling an unconfigured async method with a result of type int"
            .x(() => task = fake.QueryAsync());

            "Then it should return a completed task"
            .x(() => task.IsCompleted.Should().BeTrue());

            "And the task's result should be a dummy value"
            .x(() => task.Result.Should().Be(0));
        }
Example #5
0
        public static void UnconfiguredAsyncMethodReturnValueOfNonDummyableType(
            IFooBarService fake,
            Task<Bar> task)
        {
            "Given a fake"
                .x(() => fake = A.Fake<IFooBarService>());

            "When calling an unconfigured async method with a result of a non-dummyable type"
                .x(() => task = fake.GetBarAsync());

            "Then it should return a completed task"
                .x(() => task.IsCompleted.Should().BeTrue());

            "And the task's result should be null"
                .x(() => task.Result.Should().BeNull());
        }
Example #6
0
        public static void UnconfiguredAsyncMethodWithReturnValueOfTypeInt(
            IFooBarService fake,
            Task<int> task)
        {
            "Given a fake"
                .x(() => fake = A.Fake<IFooBarService>());

            "When calling an unconfigured async method with a result of type int"
                .x(() => task = fake.QueryAsync());

            "Then it should return a completed task"
                .x(() => task.IsCompleted.Should().BeTrue());

            "And the task's result should be a dummy value"
                .x(() => task.Result.Should().Be(0));
        }
Example #7
0
 public HomeController(IFooBarService barService, IFooBar2Service bar2Service, ISomeOtherInterface someOtherInterface)
 {
     _barService         = barService;
     _bar2Service        = bar2Service;
     _someOtherInterface = someOtherInterface;
 }
 public ValuesController(IFooBarService fooBarService)
 {
     _fooBarService = fooBarService;
 }
 public HomeController(IFooBarService barService, IFooBar2Service bar2Service, ISomeOtherInterface someOtherInterface)
 {
     _barService = barService;
     _bar2Service = bar2Service;
     _someOtherInterface = someOtherInterface;
 }