public void ShouldSupportOnlyMemberInitExpression() { //Arrange var updateDoc = new UpdateDocument <TestModel>(() => new TestModel()); //Act & Assert Assert.Throws <NotSupportedException>(() => updateDoc.ToUpdateModel()); }
public void ShouldNotPassModelWithoutChangedProperties() { //Arrange var updateDoc = new UpdateDocument <TestModel>(() => new TestModel { }); //Act & Assert Assert.Throws <InvalidOperationException>(() => updateDoc.ToUpdateModel()); }
public void ShouldSupportOnlyPropertyAssignment() { //Arrange var updateDoc = new UpdateDocument <TestModel>(() => new TestModel { List = { "foo" } }); //Act & Assert Assert.Throws <NotSupportedException>(() => updateDoc.ToUpdateModel()); }
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); }