Example #1
0
        public async Task SetAsyncHtmlFormat_ReturnsValueFromAsyncTask()
        {
            DataPackage dataPackage = new DataPackage();

            dataPackage.SetAsyncHtmlFormat(async (formatId, deadline) =>
            {
                await Task.Delay(200);
                return "Test HTML";
            });

            DataPackageView dataPackageView = dataPackage.GetView();
            string result = await dataPackageView.GetHtmlFormatAsync();

            Assert.AreEqual("Test HTML", result);
        }