SAB-E02/Blog.DAL.Tests/RepositoryTests.cs
2017-04-09 12:48:18 +02:00

31 lines
764 B
C#

using System;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using Blog.DAL.Infrastructure;
using Blog.DAL.Model;
using Blog.DAL.Repository;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
namespace Blog.DAL.Tests
{
[TestClass]
public class RepositoryTests
{
[TestMethod]
public void GetAllPost_OnePostInDb_ReturnOnePost()
{
// arrange
var context = new BlogContext();
context.Database.CreateIfNotExists();
var repository = new BlogRepository();
// act
var result = repository.GetAllPosts();
// assert
Assert.AreEqual(1, result.Count());
}
}
}