Beispiel #1
0
        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");
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public IActionResult GetProject([FromServices] GetProject getProject, int id) =>
 Ok(getProject.Do(id));
Beispiel #4
0
 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));
        }