コード例 #1
0
        public async void PreviousChainId_Create_Invalid_Reference()
        {
            Mock <IClaspRepository> claspRepository = new Mock <IClaspRepository>();

            claspRepository.Setup(x => x.ChainByPreviousChainId(It.IsAny <int>())).Returns(Task.FromResult <Chain>(null));

            var validator = new ApiClaspServerRequestModelValidator(claspRepository.Object);

            await validator.ValidateCreateAsync(new ApiClaspServerRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.PreviousChainId, 1);
        }