コード例 #1
0
        public async Task Match_FactMatchSnapshotInAsncMethod_ThrowsSnapshotTestException()
        {
            // arrange
            await Task.Delay(1);

            TestPerson testPerson = TestDataBuilder.TestPersonMarkWalton().Build();

            // act
            Func <Task> asyncMatch = () => AsyncMatch(testPerson);

            // assert
            SnapshotTestException exception =
                await Assert.ThrowsAsync <SnapshotTestException>(asyncMatch);

            Assert.Contains("async", exception.Message);

            await Task.Delay(1);
        }
コード例 #2
0
        public async Task Match_FactMatchSnapshotInSeperateClassMethodAsync_ThrowsSnapshotTestException()
        {
            // arrange
            await Task.Delay(1);

            TestPerson testPerson = TestDataBuilder.TestPersonMarkWalton().Build();

            var testClass = new AsyncSnapshotMatchTestClass();

            // act
            Func <Task> asyncMatch = () => testClass.AsyncMatchMethod(testPerson);

            // assert
            SnapshotTestException exception =
                await Assert.ThrowsAsync <SnapshotTestException>(asyncMatch);

            Assert.Contains("async", exception.Message);

            await Task.Delay(1);
        }
コード例 #3
0
        public async Task Match_TheoryMatchSnapshotInSeperateClassMethodAsync_ThrowsSnapshotTestException(int age, decimal size)
        {
            // arrange
            await Task.Delay(1);

            TestPerson testPerson = TestDataBuilder.TestPersonMarkWalton()
                                    .WithAge(age).WithSize(size).Build();

            var testClass = new AsyncSnapshotMatchTestClass();

            // act
            Func <Task> asyncMatch = () => testClass.AsyncMatchMethodWithNameExtension(
                testPerson, SnapshotNameExtension.Create(age, size));

            // assert
            SnapshotTestException exception =
                await Assert.ThrowsAsync <SnapshotTestException>(asyncMatch);

            Assert.Contains("async", exception.Message);

            await Task.Delay(1);
        }