コード例 #1
0
        public async Task UpdateAsync_ShouldUpdateGig()
        {
            var gig = await WithUnitOfWorkAsync <Gig>(() => _gigRepository.FirstOrDefaultAsync());

            var input = new CreateUpdateGigDto()
            {
                Title       = "newUpdated",
                Description = "this is Some new Description here buddy"
            };

            var result = await _gigAppService.UpdateAsync(gig.Id, input);

            result.ShouldNotBeNull();
            result.Id.ShouldBe(gig.Id);
            result.Title.ShouldBe(input.Title);
            result.Description.ShouldBe(input.Description);
        }
コード例 #2
0
        public async Task CreateAsync_Should_CreateGig()
        {
            var input = new CreateUpdateGigDto()
            {
                Title       = "Coolest Gig",
                Description = "This is a cool new gig",
                CategoryId  = Guid.Parse(Zero1FiveTestData.CategoryId),
                Cover       = new SaveFileDto()
                {
                    FileName = "coolgImage.jpg",
                    Content  = new Byte[] { 12, 34, 45, 45 }
                }
            };

            var result = await _gigAppService.CreateAsync(input);

            result.Id.ShouldNotBe(Guid.Empty);
            result.Title.ShouldBe(input.Title);
            result.Description.ShouldBe(input.Description);
        }