public void Can_GetById_Project() { //Arrange var mockRepository = new Mock <IProjectRepository>(); mockRepository.Setup(m => m.GetById(It.IsAny <int>())).Returns(new Project { Id = 1, Name = "pierwszy", Information = new ClientInformation { ContactData = "contactData1" }, Status = ProjectStatus.Active }); IGetProject service = new GetProject(mockRepository.Object); //Act ProjectDetailModel result = service.Invoke(1); //Assert Assert.True(result.Id == 1); Assert.True(result.Name == "pierwszy"); Assert.True(result.ContactData == "contactData1"); }
public string Include(Lang lang, Component comp) { var ts = lang.GetTypesSet; var ofn = GetProject.Include(lang, comp); // retrieve path from Project if (!includedLibraries.Contains(ofn)) // if not yet included { writeToCont("#include"); writeToCont(" "); writeToCont("\""); writeToCont(ts.StringFormat(ofn)); //handle formattation writeToCont("\""); writeNewLine(null); includedLibraries.Add(ofn); } return(ofn); }
public IActionResult GetProject([FromServices] GetProject getProject, int id) => Ok(getProject.Do(id));
public void OnGet([FromServices] GetProject getProject, string title) { Project = getProject.Do(title); }
public async Task <IActionResult> GetById([FromRoute] GetProject queryModel) { var result = await _bus.QueryAsync(queryModel); return(Ok(result)); }