ModelBuilder.UnitTests.DefaultExecuteStrategyTests.PopulateOnlySetsPublicPropertiesTest C# (CSharp) Method

PopulateOnlySetsPublicPropertiesTest() private method

private PopulateOnlySetsPublicPropertiesTest ( ) : void
return void
        public void PopulateOnlySetsPublicPropertiesTest()
        {
            var expected = new PropertyScopes();
            var value = Guid.NewGuid();
            var valueGenerators = new List<IValueGenerator>();

            var buildStrategy = Substitute.For<IBuildStrategy>();
            var valueGenerator = Substitute.For<IValueGenerator>();

            valueGenerators.Add(valueGenerator);

            buildStrategy.ValueGenerators.Returns(valueGenerators.AsReadOnly());

            var target = new DefaultExecuteStrategy();

            target.Initialize(buildStrategy, buildStrategy.GetBuildLog());

            valueGenerator.IsSupported(typeof(Guid), Arg.Any<string>(), Arg.Any<LinkedList<object>>()).Returns(true);
            valueGenerator.Generate(typeof(Guid), Arg.Any<string>(), Arg.Any<LinkedList<object>>()).Returns(value);

            var actual = (PropertyScopes)target.Populate(expected);

            actual.Should().BeSameAs(expected);
            actual.Public.Should().Be(value);
            actual.InternalSet.Should().BeEmpty();
            actual.ReadOnly.Should().BeEmpty();
            PropertyScopes.GlobalValue.Should().BeEmpty();
        }
DefaultExecuteStrategyTests