public void PostgreSQLProviderInsert() { DataProviderBase provider = new PostgreSQLDataProvider(new ConnectionParams() { Database = "Zenith", Password = "******", Port = 5432, Server = "localhost", Username = "******", OpenImmidiately = false }); provider.Open(); User user = new User() { Username = "******", AccessToken = "", EmailAddress = "*****@*****.**", Id = 23, IsValid = true }; DataPayload<User> payload = new DataPayload<User>() { Entity = user, Identifier = null }; DataResult result = provider.Execute(Operation.Insert, payload); Assert.IsNotNull(result); provider.Close(); Assert.IsFalse(provider.IsOpen); }
public void RavenDBProviderInsert() { DataProviderBase provider = new RavenDBDataProvider(new ConnectionParams() { Database = "Zenith", Port = 8080, Url = "http://localhost", OpenImmidiately = false }); provider.Open(); User user = new User() { Username = "******", AccessToken = "", EmailAddress = "*****@*****.**", Id = 23, IsValid = true }; DataPayload<User> payload = new DataPayload<User>() { Entity = user, Identifier = null }; DataResult result = provider.Execute(Operation.Insert, payload); Assert.IsNotNull(result); provider.Close(); Assert.IsFalse(provider.IsOpen); }
public void SQLServerInsert() { DataProviderBase provider = new SQLServerDataProvider(new ConnectionParams() { ConnectionString = @"Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=Test;Integrated Security=SSPI;AttachDBFilename=D:\Programming\DB\Test.mdf" }); provider.Open(); User user = new User() { Username = "******", AccessToken = "", EmailAddress = "*****@*****.**", Id = 23, IsValid = true }; DataPayload<User> payload = new DataPayload<User>() { Entity = user, Identifier = null }; DataResult result = provider.Execute(Operation.Insert, payload); }