Exemplo n.º 1
0
        public async Task Can_Delete_Returns_True_When_Operation_Succeeds()
        {
            var guid       = Guid.NewGuid();
            var guidString = guid.ToString("N").ToUpper();
            var request    = new GuidDataRequest()
            {
                User = "******", Expire = DateTimeOffset.UtcNow.AddDays(30).ToUnixTimeSeconds().ToString()
            };

            _repoMock.DeleteGuidData(Arg.Any <Guid>()).Returns(true);

            var actual = await _provider.DeleteGuidData(guidString);

            Assert.True(actual);

            await _repoMock.Received(1).DeleteGuidData(Arg.Any <Guid>());
        }
Exemplo n.º 2
0
        public async Task <ActionResult> DeleteGuidData(string guid)
        {
            GuidValidator.EnsureValid(guid);

            var success = await _provider.DeleteGuidData(guid);

            if (success)
            {
                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }