aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Tests/DevHive.Data.Tests/UserRepositoryTests.cs
blob: 81f62dbe69362d412c96d78dcd53f18bb6cff0e2 (plain) (blame)
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
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DevHive.Data.Models;
using DevHive.Data.Repositories;
using Microsoft.EntityFrameworkCore;
using Moq;
using NUnit.Framework;

namespace DevHive.Data.Tests
{
	[TestFixture]
	public class UserRepositoryTests
	{
		private DevHiveContext _context;
		private UserRepository _userRepository;
		private User _dummyUser;

		[SetUp]
		public void Setup()
		{
			//Naming convention: MethodName_ExpectedBehavior_StateUnderTest
			var options = new DbContextOptionsBuilder<DevHiveContext>()
				.UseInMemoryDatabase("DevHive_UserRepository_Database");

			this._context = new DevHiveContext(options.Options);
			this._userRepository = new UserRepository(_context);

			this._dummyUser = new Mock<User>().Object;

			foreach (var item in _dummyUser.Langauges)
				System.Console.WriteLine(item);

			foreach (var item in _dummyUser.Technologies)
				System.Console.WriteLine(item);
		}

		[Test]
		public void AddAsync_ShouldAddUserToDatabase()
		{

		}
	}
}