public LastModificationController() { string connectionString = "Server=tcp:lasmargaritas.database.windows.net,1433;Initial Catalog=LasMargaritasDBDev;Persist Security Info=False;User ID=LasMargaritasDbUser;Password=LasMargaritasPassw0rd!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"; if (ConfigurationManager.ConnectionStrings["LasMargaritasDb"] != null) { connectionString = ConfigurationManager.ConnectionStrings["LasMargaritasDb"].ConnectionString; } lastModificationBL = new LastModificationBL(connectionString); }
public void TestSetAndGetLastModification() { LastModificationBL bl = new LastModificationBL(connectionString); DateTime startTime = DateTime.Now; bl.SetLastModification(new LastModification() { Module = Module.Producers }); LastModification modification = bl.GetLastModification(Module.Producers); Assert.IsTrue(modification.Timestamp.HasValue); Assert.IsTrue(modification.Timestamp.Value.Subtract(startTime).TotalSeconds < 4); }
private void InsertDummyData() { string connectionString = "Server=tcp:lasmargaritas.database.windows.net,1433;Initial Catalog=LasMargaritasDBDev;Persist Security Info=False;User ID=LasMargaritasDbUser;Password=LasMargaritasPassw0rd!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"; if (ConfigurationManager.ConnectionStrings["LasMargaritasDb"] != null) { connectionString = ConfigurationManager.ConnectionStrings["LasMargaritasDb"].ConnectionString; } connectionString = ConfigurationManager.ConnectionStrings["LasMargaritasDb"].ConnectionString; LastModificationBL bl = new LastModificationBL(connectionString); DateTime startTime = DateTime.Now; bl.SetLastModification(new LastModification() { Module = Module.Producers }); }