-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathBookBenchmark.cs
More file actions
80 lines (78 loc) · 3.38 KB
/
BookBenchmark.cs
File metadata and controls
80 lines (78 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
namespace Schema.NET.Benchmarks.Core;
using System;
using System.Collections.Generic;
public class BookBenchmark : SchemaBenchmarkBase
{
public override Thing InitialiseThing() =>
new Book
{
Id = new Uri("https://example.com/book/1"),
Name = "The Catcher in the Rye",
Author = new Person
{
Name = "J.D. Salinger",
},
Url = new Uri("https://www.barnesandnoble.com/store/info/offer/JDSalinger"),
WorkExample = new List<ICreativeWork?>
{
new Book
{
Isbn = "031676948",
BookEdition = "2nd Edition",
BookFormat = BookFormatType.Hardcover,
PotentialAction = new ReadAction
{
Target = new EntryPoint
{
UrlTemplate = "https://www.barnesandnoble.com/store/info/offer/0316769487?purchase=true",
ActionPlatform = new List<Uri?>
{
new Uri("https://schema.org/DesktopWebPlatform"),
new Uri("https://schema.org/IOSPlatform"),
new Uri("https://schema.org/AndroidPlatform"),
},
},
ExpectsAcceptanceOf = new Offer
{
Price = 6.99M,
PriceCurrency = "USD",
EligibleRegion = new Country
{
Name = "US",
},
Availability = ItemAvailability.InStock,
},
},
},
new Book
{
Isbn = "031676947",
BookEdition = "1st Edition",
BookFormat = BookFormatType.EBook,
PotentialAction = new ReadAction
{
Target = new EntryPoint
{
UrlTemplate = "https://www.barnesandnoble.com/store/info/offer/031676947?purchase=true",
ActionPlatform = new List<Uri?>
{
new Uri("https://schema.org/DesktopWebPlatform"),
new Uri("https://schema.org/IOSPlatform"),
new Uri("https://schema.org/AndroidPlatform"),
},
},
ExpectsAcceptanceOf = new Offer
{
Price = 1.99M,
PriceCurrency = "USD",
EligibleRegion = new Country
{
Name = "UK",
},
Availability = ItemAvailability.InStock,
},
},
},
},
};
}