public void CollectionIsNotChangedAfterProcessingTest()
        {
            var randomCollection = new EnhancedContainer(new DoubleLinkedCollection(_randomSequenceArray));
            var collectionCount  = randomCollection.Count;

            var initialSequence = new bool[collectionCount];

            for (int i = 0; i < collectionCount; i++)
            {
                initialSequence[i] = randomCollection.Value;
                randomCollection.MoveForward();
            }

            randomCollection.CalculateLength();

            var sequenceAfterGettingCount = new bool[collectionCount];

            for (int i = 0; i < collectionCount; i++)
            {
                sequenceAfterGettingCount[i] = randomCollection.Value;
                randomCollection.MoveForward();
            }

            bool areEqual = Enumerable.SequenceEqual(initialSequence, sequenceAfterGettingCount);

            Assert.IsTrue(areEqual);
        }
        public void SameElementsSequenceProcessingReturnedWrongLengthTest()
        {
            var sameElementsSample = new[] { true, true, true };

            var sameElementsCollection = new EnhancedContainer(new DoubleLinkedCollection(sameElementsSample));

            Assert.AreEqual(sameElementsSample.Length, sameElementsCollection.Count);
        }
        public void SingleElementProcessingReturnsActualArrayLengthTest()
        {
            var singleElementSample = new[] { true };

            var singleElementCollection = new EnhancedContainer(new DoubleLinkedCollection(singleElementSample));

            Assert.AreEqual(singleElementSample.Length, singleElementCollection.Count);
        }
        public void PalindromeProcessingReturnedActualArraySizeTest()
        {
            var palindromeSample = new[] { false, true, true, false };

            var palindromeCollection = new EnhancedContainer(new DoubleLinkedCollection(palindromeSample));

            Assert.AreEqual(palindromeSample.Length, palindromeCollection.Count);
        }
        public void RepeatableElementsProcessingReturnedWrongLengthTest()
        {
            var repeatableElementsSample = new[] { true, false, true, false };

            var repeatableElementsCollection = new EnhancedContainer(
                new DoubleLinkedCollection(repeatableElementsSample));

            Assert.AreEqual(repeatableElementsSample.Length, repeatableElementsCollection.Count);
        }
Exemple #6
0
        public ThirdPartyInfoPage()
        {
            this.SetBinding(TitleProperty, "License.ProjectName");

            //Toolbar item for project site redirection
            var toolbarItem = new ToolbarItem
            {
                Text = AppResources.Website
            };

            ToolbarItems.Add(toolbarItem);
            toolbarItem.SetBinding(MenuItem.CommandProperty, "OpenWebsiteCommand");

            //Label that displays the project description
            var descriptionLabel = new Label
            {
                VerticalTextAlignment   = TextAlignment.Start,
                HorizontalTextAlignment = TextAlignment.Start,
                Margin = 5
            };

            descriptionLabel.SetBinding(Label.TextProperty, "License.Description");
            descriptionLabel.SetBinding(IsVisibleProperty, "License.Description", converter: new StringNotEmptyConverter());

            //Label that displays the license text.
            var licenseLabel = new Label
            {
                VerticalTextAlignment   = TextAlignment.Start,
                HorizontalTextAlignment = TextAlignment.Start,
                Margin = 5
            };

            licenseLabel.SetBinding(Label.TextProperty, "License.LicenseText");

            //Container that contains (haha) the licenseLabel.
            var licenseContainer = new EnhancedContainer
            {
                Content = licenseLabel
            };

            licenseContainer.SetBinding(EnhancedContainer.NameProperty, "License.LicenseName");

            Content = new ScrollView
            {
                Orientation = ScrollOrientation.Vertical,
                Content     = new StackLayout
                {
                    Spacing  = 0,
                    Children =
                    {
                        descriptionLabel,
                        licenseContainer
                    }
                }
            };
        }
Exemple #7
0
 private void CreateContainer()
 {
     _container = new EnhancedContainer(CONTAINER_PRICISION);
 }
        public void RandomSequenceProcessingReturnedActualArraySizeTest()
        {
            var randomCollection = new EnhancedContainer(new DoubleLinkedCollection(_randomSequenceArray));

            Assert.AreEqual(_randomSequenceArray.Length, randomCollection.Count);
        }