public void CreateOrUpdateAsyncAppend() { DiSetup.InMemoryDataServiceTests(); DiSetup.InitializeInMemoryEndpoints(); IDataService dataService = DiHelper.GetService <IDataService>(); bool result = dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest1Action", new ValueObject <string>("TestString")).GetAwaiter().GetResult(); Assert.AreEqual(true, result); }
public void GetAllAsync() { DiSetup.InMemoryDataServiceTests(); DiSetup.InitializeInMemoryEndpoints(); IDataService dataService = DiHelper.GetService <IDataService>(); dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action", new ValueObject <string>("TestString1")).GetAwaiter().GetResult(); dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action", new ValueObject <string>("TestString2")).GetAwaiter().GetResult(); dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action", new ValueObject <string>("TestString3")).GetAwaiter().GetResult(); dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action", new ValueObject <string>("TestString4")).GetAwaiter().GetResult(); var result = dataService.GetAllAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action").GetAwaiter().GetResult(); Assert.IsNotNull(result); Assert.AreEqual(4, result.Count()); }
public void CreateOrUpdateAsyncList() { DiSetup.InMemoryDataServiceTests(); DiSetup.InitializeInMemoryEndpoints(); IDataService dataService = DiHelper.GetService <IDataService>(); List <ValueObject <string> > items = new List <ValueObject <string> >(); items.Add(new ValueObject <string>("TestString1")); items.Add(new ValueObject <string>("TestString2")); items.Add(new ValueObject <string>("TestString3")); items.Add(new ValueObject <string>("TestString4")); bool result = dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest2Action", items).GetAwaiter().GetResult(); Assert.AreEqual(true, result); }
public void CreateOrUpdateAsyncWithDelegate() { DiSetup.InMemoryDataServiceTests(); DiSetup.InitializeInMemoryEndpoints(); IDataService dataService = DiHelper.GetService <IDataService>(); List <ValueObject <string> > items = new List <ValueObject <string> >(); items.Add(new ValueObject <string>("TestString1")); items.Add(new ValueObject <string>("TestString2")); items.Add(new ValueObject <string>("TestString3")); items.Add(new ValueObject <string>("TestString4")); dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest3Action", items).GetAwaiter().GetResult(); bool resultAdd = dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest3Action", new ValueObject <string>("TestString"), x => x.Value.Equals("DunnoYet")).GetAwaiter().GetResult(); bool resultUpdate = dataService.CreateOrUpdateAsync <ValueObject <string> >("CreateOrUpdateAsyncTest3Action", new ValueObject <string>("TestString"), x => x.Value.Equals("TestString4")).GetAwaiter().GetResult(); int numberafterwards = dataService.GetAllAsync <ValueObject <string> >("CreateOrUpdateAsyncTest3Action").GetAwaiter().GetResult().Count(); Assert.AreEqual(true, resultAdd); Assert.AreEqual(true, resultUpdate); Assert.AreEqual(5, numberafterwards); }