unit tests

This commit is contained in:
Sean Garrett
2023-06-15 21:56:47 +01:00
parent 0cf6a7e5d3
commit 54e756c695
18 changed files with 817 additions and 8 deletions
@@ -0,0 +1,13 @@
namespace CoreUnitTests.Infrastructure.Model;
public class Child
{
public Child(string type, string value)
{
Type = type;
Value = value;
}
public string Type { get; set; }
public string Value { get; set; }
}
@@ -0,0 +1,13 @@
using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace CoreUnitTests.Infrastructure.Model;
public class Nested
{
public DateTime SomeDate { get; set; }
[BsonRepresentation(BsonType.Decimal128)]
public decimal SomeAmount { get; set; }
}
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using MongoDbGenericRepository.Models;
namespace CoreUnitTests.Infrastructure.Model;
public class TestDocument : Document
{
public TestDocument()
{
Version = 2;
Nested = new Nested
{
SomeDate = DateTime.UtcNow
};
Children = new List<Child>();
}
public int SomeValue { get; set; }
public string SomeContent { get; set; }
public string SomeContent2 { get; set; }
public string SomeContent3 { get; set; }
public int GroupingKey { get; set; }
public Nested Nested { get; set; }
public List<Child> Children { get; set; }
}
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using MongoDbGenericRepository.Models;
namespace CoreUnitTests.Infrastructure.Model;
public class TestDocumentWithKey : IDocument<int>
{
public int Id { get; set; }
public int Version { get; set; }
public TestDocumentWithKey()
{
Version = 2;
Nested = new Nested
{
SomeDate = DateTime.UtcNow
};
Children = new List<Child>();
}
public int SomeValue { get; set; }
public string SomeContent { get; set; }
public string SomeContent2 { get; set; }
public string SomeContent3 { get; set; }
public int GroupingKey { get; set; }
public Nested Nested { get; set; }
public List<Child> Children { get; set; }
}