-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonStoreTests.cs
More file actions
47 lines (41 loc) · 1.11 KB
/
JsonStoreTests.cs
File metadata and controls
47 lines (41 loc) · 1.11 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
using Birko.Data.Models;
using FluentAssertions;
using System;
using System.IO;
using Xunit;
namespace Birko.Data.JSON.Tests;
public class TestModel : AbstractModel
{
public string Name { get; set; } = string.Empty;
public int Value { get; set; }
}
public class JsonStoreTests
{
[Fact]
public void Constructor_Default_ShouldNotThrow()
{
var store = new Birko.Data.JSON.Stores.JsonStore<TestModel>();
store.Should().NotBeNull();
}
[Fact]
public void Read_WithNoInit_ShouldReturnEmpty()
{
var store = new Birko.Data.JSON.Stores.JsonStore<TestModel>();
var result = store.Read();
result.Should().BeEmpty();
}
[Fact]
public void Count_WithNoInit_ShouldReturnZero()
{
var store = new Birko.Data.JSON.Stores.JsonStore<TestModel>();
var result = store.Count();
result.Should().Be(0);
}
[Fact]
public void Read_WithEmptyGuid_ShouldReturnNull()
{
var store = new Birko.Data.JSON.Stores.JsonStore<TestModel>();
var result = store.Read(Guid.Empty);
result.Should().BeNull();
}
}