Ejemplo n.º 1
0
        public async Task ShouldNotFindUser()
        {
            await using (var context = new DbContextFactory().CreateContext())
            {
                var service = new UserServiceFactory().Create(context);

                FluentActions.Invoking(async() => await service.UpdateAvatar(Guid.NewGuid(), null))
                .Should().Throw <UserNotFoundException>();
            }
        }
Ejemplo n.º 2
0
        public async Task ShouldUpdate()
        {
            await using (var context = new DbContextFactory().CreateContext())
            {
                var service = new UserServiceFactory().Create(context);

                var result = await service.UpdateAvatar(new Guid("046E876E-D413-45AF-AC2A-552D7AA46C5C"),
                                                        new byte[] { 0, 0, 0, 0 });

                result.Should().NotBe(Encoding.UTF8.GetString(new Byte[] { 1, 1, 1, 1 }, 0, 4));
                result.Should().Be(Encoding.UTF8.GetString(new Byte[] { 0, 0, 0, 0 }, 0, 4));
            }
        }