Пример #1
0
        public async Task CreateAndLoadAsync([Values(1, 10, 100)] int n)
        {
            List <WidgetCreateRequest> requests = new List <WidgetCreateRequest>();

            for (int i = 0; i < n; i++)
            {
                WidgetCreateRequest request = new WidgetCreateRequest()
                {
                    S1 = Gnosis.Testing.Utility.GetRandomPhrase()
                };
                Debug.Print(request.S1);

                requests.Add(request);
                await manager.CreateWidgetAsync(request);
            }

            List <Widget> widgets = (await manager.LoadWidgetsAsync <Widget>(requests.Select(x => x.Id))).ToList();

            Assert.AreEqual(n, widgets.Count());

            for (int i = 0; i < n; i++)
            {
                Assert.AreEqual(requests[i].Id, widgets[i].Id);
                Assert.AreEqual(requests[i].S1, widgets[i].S1);
            }
        }