Esempio n. 1
0
        public void Clone_ShallowClonesDefaultTabOptions()
        {
            // Arrange
            var dummyAttributes            = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>());
            var dummyFlexiTabBlockOptions  = new FlexiTabBlockOptions(dummyAttributes);
            var dummyFlexiTabsBlockOptions = new FlexiTabsBlockOptions(defaultTabOptions: dummyFlexiTabBlockOptions);

            // Act
            var result = (FlexiTabsBlockOptions)dummyFlexiTabsBlockOptions.Clone();

            // Assert
            Assert.NotSame(dummyFlexiTabBlockOptions, result.DefaultTabOptions);
            // This is fine since if attributes are specified in JSON, the entire collection is replaced -
            // i.e. we won't mess up the attributes collection of the original FlexiTabBlockOptions instance.
            Assert.Same(dummyAttributes, result.DefaultTabOptions.Attributes);
        }