109 lines
4.1 KiB
C#
109 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text.Json;
|
|
using Strata.Analytics.Models.Workbooks;
|
|
|
|
namespace Strata.Analytics.Test.Unit.Biz.TestData
|
|
{
|
|
internal static class WorkbookTestData
|
|
{
|
|
private static readonly Guid UserGuid1 = Guid.NewGuid();
|
|
private static readonly Guid UserGuid2 = Guid.NewGuid();
|
|
|
|
public static IQueryable<Workbook> Workbooks()
|
|
{
|
|
var workbooks = new List<Workbook>
|
|
{
|
|
new()
|
|
{
|
|
WorkbookId = 1,
|
|
Name = "Workbook 1",
|
|
Description = "This is Workbook 1",
|
|
DefaultDataSourceId = 1001,
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid1,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
},
|
|
new()
|
|
{
|
|
WorkbookId = 2,
|
|
Name = "Workbook 2",
|
|
Description = "This is Workbook 2",
|
|
DefaultDataSourceId = 2001,
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid1,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
}
|
|
};
|
|
return workbooks.AsQueryable();
|
|
}
|
|
|
|
public static IQueryable<Worksheet> Worksheets()
|
|
{
|
|
var worksheets = new List<Worksheet>
|
|
{
|
|
new()
|
|
{
|
|
WorksheetId = 101,
|
|
WorkbookId = 1,
|
|
Name = "Worksheet 101",
|
|
WorksheetType = WorksheetType.Adhoc,
|
|
Content = JsonDocument.Parse("{\"MyContent\": \"WS 101\"}"),
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid2,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
},
|
|
new()
|
|
{
|
|
WorksheetId = 102,
|
|
WorkbookId = 1,
|
|
Name = "Worksheet 102",
|
|
WorksheetType = WorksheetType.Blank,
|
|
Content = JsonDocument.Parse("{\"MyContent\": \"WS 102\"}"),
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid1,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
},
|
|
new()
|
|
{
|
|
WorksheetId = 103,
|
|
WorkbookId = 1,
|
|
Name = "Worksheet 103",
|
|
WorksheetType = WorksheetType.Dashboard,
|
|
Content = JsonDocument.Parse("{\"MyContent\": \"WS 103\"}"),
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid1,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
},
|
|
new()
|
|
{
|
|
WorksheetId = 201,
|
|
WorkbookId = 2,
|
|
Name = "Worksheet 201",
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid2,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
},
|
|
new()
|
|
{
|
|
WorksheetId = 202,
|
|
WorkbookId = 2,
|
|
Name = "Worksheet 202",
|
|
CreatedByUserGuid = UserGuid1,
|
|
UpdatedByUserGuid = UserGuid2,
|
|
CreatedDate = DateTime.UtcNow.AddDays(-1),
|
|
UpdatedDate = DateTime.UtcNow.AddHours(-1)
|
|
}
|
|
};
|
|
return worksheets.AsQueryable();
|
|
}
|
|
}
|
|
}
|