Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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
            });
        }