public void Test_IsPalindrome() { var exercise12 = new Exercise12(); Assert.AreEqual(exercise12.IsPalindrome(12321), true); Assert.AreEqual(exercise12.IsPalindrome(101010), false); }
public void TestSimpleFilter() { var actualResult = Exercise12.Flatten(new Filter()); Assert.IsNotNull(actualResult); Assert.AreEqual(1, actualResult.Count); Assert.IsNotNull(actualResult.First()); Assert.AreEqual(1, actualResult.First().Length); }
public void TestSimpleFilter() { var actualResult = Exercise12.Flatten(new Filter()); actualResult.Should().NotBeNull(); actualResult.Count.Should().Be(1); actualResult.First().Should().NotBeNull(); actualResult.First().Length.Should().Be(1); }
public void TestSingleCompositeAllFilter() { var filters = new CompositeFilter(CompositeFilterOperation.All, new Filter(), new Filter(), new Filter()); var actualResult = Exercise12.Flatten(filters); Assert.IsNotNull(actualResult); Assert.AreEqual(1, actualResult.Count); Assert.IsNotNull(actualResult.First()); Assert.AreEqual(3, actualResult.First().Length); }
public void TestSingleCompositeAllFilter() { var filters = new CompositeFilter(CompositeFilterOperation.All, new Filter(), new Filter(), new Filter()); var actualResult = Exercise12.Flatten(filters); actualResult.Should().NotBeNull(); actualResult.Count.Should().Be(1); actualResult.First().Should().NotBeNull(); actualResult.First().Length.Should().Be(3); }
public void TestNestedCompositeAnyFilter() { var filters = new CompositeFilter(CompositeFilterOperation.All, new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()), new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()), new CompositeFilter(CompositeFilterOperation.All, new Filter(), new Filter()), new Filter()); var actualResult = Exercise12.Flatten(filters); Assert.IsNotNull(actualResult); Assert.AreEqual(8, actualResult.Count); }
public void TestNestedCompositeAnyFilter() { var filters = new CompositeFilter(CompositeFilterOperation.All, new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()), new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()), new CompositeFilter(CompositeFilterOperation.All, new Filter(), new Filter()), new Filter()); var actualResult = Exercise12.Flatten(filters); actualResult.Should().NotBeNull(); actualResult.Count.Should().Be(8); }
public void TestSingleCompositeAnyFilter() { var filters = new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()); var actualResult = Exercise12.Flatten(filters); Assert.IsNotNull(actualResult); Assert.AreEqual(3, actualResult.Count); foreach (var filterSet in actualResult) { Assert.IsNotNull(filterSet); Assert.AreEqual(1, filterSet.Length); } }
public void TestSingleCompositeAnyFilter() { var filters = new CompositeFilter(CompositeFilterOperation.Any, new Filter(), new Filter(), new Filter()); var actualResult = Exercise12.Flatten(filters); actualResult.Should().NotBeNull(); actualResult.Count.Should().Be(3); foreach (var filterSet in actualResult) { filterSet.Should().NotBeNull(); filterSet.Length.Should().Be(1); } }
public void Test_SymmetricNumber_Ok(int n, bool result) { Assert.AreEqual(Exercise12.SymmetricNumber(n), result); }