Example #1
0
        public void TestBinaryOperationsOnStringColumn()
        {
            var        df           = new DataFrame();
            BaseColumn stringColumn = new StringColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString()));

            df.InsertColumn(0, stringColumn);

            BaseColumn newCol = stringColumn.Equals(5);

            Assert.Equal(true, newCol[5]);
            Assert.Equal(false, newCol[0]);

            BaseColumn stringColumnCopy = new StringColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString()));

            newCol = stringColumn.Equals(stringColumnCopy);
            Assert.Equal(true, newCol[5]);
            Assert.Equal(true, newCol[0]);

            newCol = stringColumn.NotEquals(5);
            Assert.Equal(false, newCol[5]);
            Assert.Equal(true, newCol[0]);

            newCol = stringColumn.NotEquals(stringColumnCopy);
            Assert.Equal(false, newCol[5]);
            Assert.Equal(false, newCol[0]);
        }
Example #2
0
        public void EqualTests(StringColumn first, object second, bool expectedResult, string reason)
        {
            _outputHelper.WriteLine($"{nameof(first)} : {first}");
            _outputHelper.WriteLine($"{nameof(second)} : {second}");

            // Act
            bool actualResult = first.Equals(second);

            // Assert
            actualResult.Should().Be(expectedResult, reason);
        }