本文整理汇总了C#中Employee.SetEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Employee.SetEmail方法的具体用法?C# Employee.SetEmail怎么用?C# Employee.SetEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee.SetEmail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRiskAssessor
private static RiskAssessor CreateRiskAssessor()
{
var employee = new Employee() {Id = Guid.NewGuid()};
employee.SetEmail("[email protected]", null);
return new RiskAssessor() {Id = 123123, Employee = employee};
}
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:7,代码来源:GetFireRiskAssessmentFurtherControlMeasureTaskRiskAssessorsQueryTests.cs
示例2: Given_person_seen_is_an_employee_and_not_in_list_when_AddPersonSeen_then_added_to_list
public void Given_person_seen_is_an_employee_and_not_in_list_when_AddPersonSeen_then_added_to_list()
{
//GIVEN
var checklist = new BusinessSafe.Domain.Entities.SafeCheck.Checklist();
var employee = new Employee();
employee.Id = Guid.NewGuid();
employee.Forename = "Alester";
employee.Surname = "Oakheart";
employee.SetEmail("[email protected]",null);
var personSeen = ChecklistPersonSeen.Create(employee);
//WHEN
checklist.AddPersonSeen(personSeen);
//THEN
Assert.That(checklist.PersonsSeen.Count, Is.EqualTo(1));
Assert.That(checklist.PersonsSeen[0].Id, Is.Not.EqualTo(string.Empty));
Assert.That(checklist.PersonsSeen[0].Employee.Id, Is.EqualTo(employee.Id));
Assert.That(checklist.PersonsSeen[0].FullName, Is.EqualTo(employee.FullName));
Assert.That(checklist.PersonsSeen[0].EmailAddress, Is.EqualTo(employee.GetEmail()));
Assert.That(checklist.PersonsSeen[0].Checklist, Is.EqualTo(checklist));
}
示例3: Given_person_seen_is_an_employee_and_in_list_when_RemovePersonSeen_then_removed_from_list
public void Given_person_seen_is_an_employee_and_in_list_when_RemovePersonSeen_then_removed_from_list()
{
//GIVEN
var checklist = new BusinessSafe.Domain.Entities.SafeCheck.Checklist();
var employee = new Employee();
employee.Id = Guid.NewGuid();
employee.Forename = "Alester";
employee.Surname = "Oakheart";
employee.SetEmail("[email protected]",null);
var personSeenToRemove = ChecklistPersonSeen.Create(employee);
var personSeen = ChecklistPersonSeen.Create(employee);
checklist.AddPersonSeen(personSeen);
//WHEN
checklist.RemovePersonSeen(personSeenToRemove);
//THEN
Assert.That(checklist.PersonsSeen.Count, Is.EqualTo(0));
}
示例4: Given_contact_details_When_SetEmail_Then_should_set_contact_details_correctly
public void Given_contact_details_When_SetEmail_Then_should_set_contact_details_correctly()
{
// Given
var employee = new Employee()
{
ContactDetails = new List<EmployeeContactDetail>() { new EmployeeContactDetail() }
};
// When
employee.SetEmail("[email protected]", new UserForAuditing());
// Then
Assert.That(employee.ContactDetails.Count, Is.EqualTo(1));
Assert.That(employee.ContactDetails.First().Email, Is.EqualTo("[email protected]"));
}
示例5: Given_a_checklist_with_an_employee_as_persons_seen_then_person_seen_model_is_correct
public void Given_a_checklist_with_an_employee_as_persons_seen_then_person_seen_model_is_correct()
{
//GIVEN
var employee1 = new Employee() { Id = Guid.NewGuid(), Forename = "Ilyn", Surname = "Payne"};
employee1.SetEmail("[email protected]", null);
var employee2 = new Employee() {Id = Guid.NewGuid() };
var checklist = new Checklist() {Id = Guid.NewGuid()};
checklist.AddPersonSeen(ChecklistPersonSeen.Create(employee1));
checklist.AddPersonSeen(ChecklistPersonSeen.Create(employee2));
checklistRepo.Setup(x => x.GetById(It.IsAny<Guid>()))
.Returns(() => checklist);
//when
var target = new ChecklistController(dependencyFactory.Object);
var result = target.GetChecklist(checklist.Id);
//THEN
Assert.That(result.PersonsSeen.Count,Is.EqualTo(2));
Assert.That(result.PersonsSeen[0].EmployeeId, Is.EqualTo(employee1.Id));
Assert.That(result.PersonsSeen[0].FullName, Is.EqualTo(employee1.FullName));
Assert.That(result.PersonsSeen[0].EmailAddress, Is.EqualTo(employee1.GetEmail()));
}