Beispiel #1
0
        /// <summary>
        /// InMemory!
        /// </summary>
        /// <returns></returns>
        public static ITableSnapshotBuilder EmptySnapshot()
        {
            TableSnapshotBuilder b = new TableSnapshotBuilder();

            b.TableSnapshotDelegate = () =>
            {
                SqliteDatabaseProvider prov = SqliteDatabaseProvider.CreateInMemoryDatabase();
                IssueListSnapshotBuilder.CreateTable(prov);
                SqliteTableSnapshot ts = new SqliteTableSnapshot(prov, IssueTableSnapshot.TableName, IssueTableSnapshot.PrimaryKey);
                return(ts);
            };
            return(b);
        }
Beispiel #2
0
        public static ITableSnapshotBuilder CreateInMemorySnapshotFromRequest(IEnumerable <string> jsonResponses)
        {
            Guard.ArgumentNotNull(jsonResponses, nameof(jsonResponses));
            TableSnapshotBuilder b = new TableSnapshotBuilder();

            b.TableSnapshotDelegate = () =>
            {
                SqliteDatabaseProvider prov = SqliteDatabaseProvider.CreateInMemoryDatabase();
                IssueListSnapshotBuilder.Fill(prov, jsonResponses);

                SqliteTableSnapshot ts = new SqliteTableSnapshot(prov, IssueTableSnapshot.TableName, IssueTableSnapshot.PrimaryKey);
                return(ts);
            };
            return(b);
        }