示例#1
0
        public void RelationshipRepository_Should_Call_Remove()
        {
            var DbContextMock = new Mock <INotebookDbContext>();

            DbContextMock.Setup(c => c.Relationships.Remove(It.IsAny <Relationship>()));

            var repo = new RelationshipRepository();

            repo.setContext(DbContextMock.Object);

            repo.Delete(new Relationship());

            DbContextMock.Verify(c => c.Relationships.Remove(It.IsAny <Relationship>()), Times.Once);
        }
 /// <summary>
 ///     Delete Relationship
 /// </summary>
 /// <param name="id"></param>
 /// <param name="typeId"></param>
 public void Delete(long id, int typeId)
 {
     RelationshipRepository.Delete(id, (PersonType)typeId);
 }