Exemple #1
0
        public static void PopulateTrashboxDatabase()
        {
            DataBaseUtils db =
                new DataBaseUtils(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            var receiptEntityId =
                db.ExecuteSqlQueryScalar(
                    $"INSERT INTO ReceiptEntities (Date, Title, Currency, Status, Deleted, Comment, OwnerId, IsNew) VALUES(CONVERT(DATETIME, '2017-03-03 00:00:00', 102), N'AutomatedTestData', 0, 0, 1, N'Comment', N'63902c24-2046-409d-bc8d-e2827c212c25', 1); SELECT SCOPE_IDENTITY()");

            Debug.WriteLine($"Test data prepared, ReceiptEntity id = {receiptEntityId}");

            db.ExecuteSqlQuery(
                $"INSERT INTO FileEntities(id, Name, Hash, Viewable, UploadDate) values({receiptEntityId}, 'AutomatedTestData.jpg', '', 1, CONVERT(DATETIME, '2017-03-03 00:00:00', 102))");
        }
Exemple #2
0
        public static void PopulateExpenseDraftsDatabase()
        {
            DataBaseUtils db =
                new DataBaseUtils(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            var receiptEntityId =
                db.ExecuteSqlQueryScalar(
                    $"INSERT INTO ReceiptEntities (Date, Title, CurrencyId, Status, IsTrash, OwnerId, IsNew) VALUES(CONVERT(DATETIME, '2017-03-03 00:00:00', 102), N'AutomatedTestData.jpg', 1, 1, 0, N'4cef5297-989d-4300-a17f-94fdb0b7907c', 1); SELECT SCOPE_IDENTITY()");

            Debug.WriteLine($"Test data prepared, ReceiptEntity id = {receiptEntityId}");

            db.ExecuteSqlQuery(
                $"INSERT INTO FileEntities(id, Name, Hash, Viewable, UploadDate) values({receiptEntityId}, 'AutomatedTestData.jpg', '', 1, CONVERT(DATETIME, '2017-03-03 00:00:00', 102))");
        }