Exemplo n.º 1
0
        public async Task TestA2Async()
        {
            IThing thing  = GetInstance(true);
            string result = await thing.GetNumberAsTextAsync(Data.Number);

            Assert.AreEqual(Data.NumberAsText, result);
        }
Exemplo n.º 2
0
        protected static IThing GetInstance(bool mock)
        {
            IThing GetMockedInstance()
            {
                IThing thing = Substitute.For <IThing>();

                thing.GetNumberAsTextAsync(Data.Number).Returns(Task.FromResult(Data.NumberAsText));
                return(thing);
            }

            return(mock ? GetMockedInstance() : new Thing());
        }
Exemplo n.º 3
0
        public static async Task TestB2Async(IThing thing)
        {
            string result = await thing.GetNumberAsTextAsync(Data.Number);

            Assert.AreEqual(Data.NumberAsText, result);
        }