Beispiel #1
0
        public void ReplacingOneSearchPropertyWithAnotherActuallyReplacesAllProperties()
        {
            var fakePlatform  = A.Fake <IPlatformSpecific>();
            var firstProperty = new SearchProperties()
            {
                Query          = "My first query",
                ItemTypeIndex  = 0,
                Language       = Language.GetUnknown(fakePlatform),
                OrderAscending = true,
                SortType       = SearchProperties.SearchPropertiesSortType.ByCreationDate,
                Tag            = default(Tag)
            };
            var secondProperty = new SearchProperties()
            {
                Query          = "My second query",
                ItemTypeIndex  = 1,
                Language       = new Language("de"),
                OrderAscending = false,
                SortType       = SearchProperties.SearchPropertiesSortType.ByReadingTime,
                Tag            = new Tag()
                {
                    Label = "test"
                }
            };

            firstProperty.Replace(secondProperty);

            Assert.Equal("My second query", firstProperty.Query);
            Assert.Equal(1, firstProperty.ItemTypeIndex);
            Assert.Equal(new Language("de"), firstProperty.Language);
            Assert.Equal(false, firstProperty.OrderAscending);
            Assert.Equal(SearchProperties.SearchPropertiesSortType.ByReadingTime, firstProperty.SortType);
            Assert.Equal("test", firstProperty.Tag.Label);
        }