예제 #1
0
        public async Task Lists_Single_Space()
        {
            await _spaceRepository.Add(new Space(new SpaceName("hello")));

            var listSpacesPresenter = new ListSpacesPresenter();
            var useCase             = new Application.UseCases.ListSpaces(listSpacesPresenter, _spaceService);

            var input = new ListSpacesInput();
            await useCase.Execute(input);

            var output = listSpacesPresenter.ListedSpaces.Single().ExistingSpaces;

            Assert.Equal(output.GetSpaceNames(), new List <SpaceName> {
                new SpaceName("hello")
            });
        }
예제 #2
0
        public async Task Single_Space_Can_Be_Fetched()
        {
            await _repository.Add(new Space(new SpaceName("single")));

            Space space = (Space)await _repository.Get(new SpaceName("single"));

            Assert.NotNull(space);
            Assert.Equal("single", space.Name.ToString());
            Assert.Equal(
                new DirectoryInfo(Path.Combine(_rootPath, "single")).FullName,
                space.BaseDirectory?.FullName);
        }