Baseline.Testing.Reflection.ArrayIndexerTester.SetValueOnArrayWithValueType C# (CSharp) Method

SetValueOnArrayWithValueType() private method

private SetValueOnArrayWithValueType ( ) : void
return void
        public void SetValueOnArrayWithValueType()
        {
            var accessor = ReflectionHelper.GetAccessor<DateTime[]>(x => x[1]);

            var original = new DateTime(2015, 01, 01);
            var replacement = new DateTime(2015, 01, 02);
            var target = new[] { new DateTime(2015, 01, 03), original };

            accessor.SetValue(target, replacement);
            target[1].ShouldNotBe(original);
            target[1].ShouldBe(replacement);
        }