public void given_valid_company_when_getviewmodel_then_result_contains_correct_AccidentTypes() { //given var accidentType = new AccidentTypeDto { Id = 1L }; var accidentTypes = new List<AccidentTypeDto> { accidentType }; _accidentTypeService.Setup(x => x.GetAllForCompany(It.IsAny<long>())).Returns(accidentTypes); var factory = GetTarget(); //when var result = factory .WithCompanyId(1L) .GetViewModel(); //then Assert.That(result.AccidentTypes.Skip(1).First().value, Is.EqualTo(accidentType.Id.ToString())); }
public static AutoCompleteViewModel ForAccidentType(AccidentTypeDto accidentTypeDto) { return new AutoCompleteViewModel(accidentTypeDto.Description, accidentTypeDto.Id.ToString()); }