Beispiel #1
0
        public void GetError_ShouldReturnCorrectValue(
            SampleValidable sut)
        {
            //arrange

            //act
            var actual = sut.GetError("Property");

            //assert
            actual.Should().Be(NoError.Value);
        }
Beispiel #2
0
        public async Task GetError_WithValidatedPropertyWithNoError_ShouldReturnCorrectValue(
            [Frozen] Mock <IValidator> validator,
            SampleValidable sut,
            string value)
        {
            //arrange
            validator.Setup(v => v.Validate(value, "Property", It.IsAny <CancellationToken>()))
            .ReturnsTask(NoError.Value);
            //act
            await sut.SetValueAsyncPublic(value, "Property", new CancellationTokenSource());

            var actual = sut.GetError("Property");

            //assert
            actual.Should().Be(NoError.Value);
        }