Exemplo n.º 1
0
        public void UndefinedVoidMethod(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
                .x(() => foo = new FooAsyncAwait(A.Fake<IFooAsyncAwaitService>()));

            "when calling undefined void method"
                .x(() => task = foo.CommandAsync());

            "it should return"
                .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 2
0
        public static void UndefinedVoidMethod(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
            .x(() => foo = new FooAsyncAwait(A.Fake <IFooAsyncAwaitService>()));

            "when calling undefined void method"
            .x(() => task = foo.CommandAsync());

            "it should return"
            .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 3
0
        public void UndefinedMethodWithReturnValue(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
                .x(() => foo = new FooAsyncAwait(A.Fake<IFooAsyncAwaitService>()));

            "when calling undefined method with return value"
                .x(() => task = foo.QueryAsync());

            "it should return"
                .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 4
0
        public static void UndefinedMethodWithReturnValue(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
            .x(() => foo = new FooAsyncAwait(A.Fake <IFooAsyncAwaitService>()));

            "when calling undefined method with return value"
            .x(() => task = foo.QueryAsync());

            "it should return"
            .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 5
0
        public void DefinedVoidMethod(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
                .x(() =>
                    {
                        var service = A.Fake<IFooAsyncAwaitService>();
                        A.CallTo(() => service.CommandAsync()).Returns(Task.FromResult<object>(null));
                        foo = new FooAsyncAwait(service);
                    });

            "when calling defined void method"
                .x(() => task = foo.CommandAsync());

            "it should return"
                .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 6
0
        public void DefinedMethodWithReturnValue(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
                .x(() =>
                    {
                        var service = A.Fake<IFooAsyncAwaitService>();
                        A.CallTo(() => service.QueryAsync()).Returns(Task.FromResult(9));
                        foo = new FooAsyncAwait(service);
                    });

            "when calling defined method with return value"
                .x(() => task = foo.QueryAsync());

            "it should return"
                .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 7
0
        public static void DefinedVoidMethod(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
            .x(() =>
            {
                var service = A.Fake <IFooAsyncAwaitService>();
                A.CallTo(() => service.CommandAsync()).Returns(Task.FromResult <object>(null));
                foo = new FooAsyncAwait(service);
            });

            "when calling defined void method"
            .x(() => task = foo.CommandAsync());

            "it should return"
            .x(() => task.IsCompleted.Should().BeTrue());
        }
Exemplo n.º 8
0
        public static void DefinedMethodWithReturnValue(
            FooAsyncAwait foo,
            Task task)
        {
            "establish"
            .x(() =>
            {
                var service = A.Fake <IFooAsyncAwaitService>();
                A.CallTo(() => service.QueryAsync()).Returns(Task.FromResult(9));
                foo = new FooAsyncAwait(service);
            });

            "when calling defined method with return value"
            .x(() => task = foo.QueryAsync());

            "it should return"
            .x(() => task.IsCompleted.Should().BeTrue());
        }