Exemple #1
0
        public void ShouldSupportOnlyMemberInitExpression()
        {
            //Arrange
            var updateDoc = new UpdateDocument <TestModel>(() => new TestModel());

            //Act & Assert
            Assert.Throws <NotSupportedException>(() => updateDoc.ToUpdateModel());
        }
Exemple #2
0
        public void ShouldNotPassModelWithoutChangedProperties()
        {
            //Arrange
            var updateDoc = new UpdateDocument <TestModel>(() => new TestModel
            {
            });

            //Act & Assert
            Assert.Throws <InvalidOperationException>(() => updateDoc.ToUpdateModel());
        }
Exemple #3
0
        public void ShouldSupportOnlyPropertyAssignment()
        {
            //Arrange
            var updateDoc = new UpdateDocument <TestModel>(() => new TestModel
            {
                List = { "foo" }
            });

            //Act & Assert
            Assert.Throws <NotSupportedException>(() => updateDoc.ToUpdateModel());
        }
Exemple #4
0
        public void ShouldCreateObjectWithSpecifiedParameters()
        {
            //Arrange
            var updateDoc = new UpdateDocument <TestModel>(() => new TestModel
            {
                Value = "foo"
            });

            //Act
            var updateModel = updateDoc.ToUpdateModel();

            //Assert
            Assert.NotNull(updateModel);
            Assert.Equal("foo", updateModel.val);
        }