mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-25 14:06:35 +02:00
Legacy testing lib added..
This commit is contained in:
parent
0167fc321f
commit
47ed05837e
118 changed files with 17505 additions and 0 deletions
|
@ -0,0 +1,50 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestAccountExtensions
|
||||
{
|
||||
/// <summary> If no user is logged in filter is not applied. </summary>
|
||||
[Test]
|
||||
public void TestDoFilter_NoUserLoggedIn()
|
||||
{
|
||||
var l_oAccount = MockRepository.GenerateMock<IAccount>();
|
||||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return(""); // User is not logged in
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(3, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("Konrad", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[2]);
|
||||
}
|
||||
/// <summary> </summary>
|
||||
[Test]
|
||||
public void TestDoFilter()
|
||||
{
|
||||
var l_oAccount = MockRepository.GenerateMock<IAccount>();
|
||||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return("123");
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(2, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[1]);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue