Example #1
0
        public void it_can_return_changed_measures()
        {
            // Arrange
            var original = new FakeMeasureEntity
            {
                Key1 = "Key1Value",
                Key2 = "Key2Value",
                Mea1 = 1,
                Mea2 = 2,
                Mea3 = 3,
                Mea4 = 4
            };
            var delta = new FakeMeasureEntity
            {
                Key1 = "Key1Value",
                Key2 = "Key2Value",
                Mea1 = 11,
                Mea2 = 2,
                Mea3 = 3,
                Mea4 = 4
            };
            var entityInfo = original.GetEntityProperties();
            var update = new Update(_edgeMartUrl, original, delta, entityInfo);

            // Act
            var absolute = update.ToUri(UpdateType.Measure);

            // Assert
            Assert.True(absolute.Query.Contains("&filters=Key1:Key1Value&filters=Key2:Key2Value"));
            Assert.True(absolute.Query.Contains("&measures=Mea1:1"));
            Assert.True(absolute.Query.Contains("&values=Mea1:11"));
            Assert.False(absolute.Query.Contains("&measures=Mea2"));
            Assert.False(absolute.Query.Contains("&measures=Mea3"));
            Assert.False(absolute.Query.Contains("&measures=Mea4"));
        }
Example #2
0
        public void it_can_get_lists_for_an_entity_with_no_dimensions()
        {
            // Arrange
            IEntity entity = new FakeMeasureEntity();

            // Act
            IEntityInfo ei = entity.GetEntityProperties();

            // Assert
            Assert.NotNull(ei);
            Assert.NotNull(ei.Keys);
            Assert.NotNull(ei.Dimensions);
            Assert.NotNull(ei.Measures);
            Assert.AreEqual(2, ei.Keys.Count);
            Assert.AreEqual(0, ei.Dimensions.Count);
            Assert.AreEqual(4, ei.Measures.Count);
        }