- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
[TestInitialize]
public void Init()
{
relashions = new List<PersonRelationship>();
relashions.Add( new PersonRelationship()
{
PersonId = 1,
RalationshipPersonId = 2,
RelationshipTypeId = (int)DAL.Dictionaries.RelationshipType.Friend
});
relashions.Add(new PersonRelationship()
{
PersonId = 1,
RalationshipPersonId = 2,
RelationshipTypeId = (int)DAL.Dictionaries.RelationshipType.Friend
});
relashions.Add(new PersonRelationship()
{
PersonId = 2,
RalationshipPersonId = 1,
RelationshipTypeId = (int)DAL.Dictionaries.RelationshipType.Friend
});
}
[TestMethod()]
public void GetMyFriends_Get_Success()
{
long personId = 1;
var relationService = new Mock<IRelationService>();
relationService.Setup(c => c.GetMyFriends(personId)).Returns
(
from rl in relashions.Where(r => r.PersonId == personId && r.RelationshipTypeId == (int)DAL.Dictionaries.RelationshipType.Friend)
select new PersonShortDescriptionViewModel()
{
FirstName = personId.ToString(),
LastName = personId.ToString(),
}
);
var friends = relationService.Object.GetMyFriends(personId);
Assert.IsNotNull(friends);
}