public void ValidatingSerializationInfoShouldThrowIfBaseTypeNameNotSet()
        {
            Action action = () => ODataResourceSerializationInfo.Validate(new ODataResourceSerializationInfo {
                NavigationSourceName = "Set", NavigationSourceKind = EdmNavigationSourceKind.EntitySet
            });

            action.ShouldThrow <ArgumentNullException>().Where(e => e.Message.Contains("serializationInfo.NavigationSourceEntityTypeName"));
        }
Exemple #2
0
        public void ValidatingSerializationInfoShouldThrowIfBaseTypeNameNotSet()
        {
            Action action = () => ODataResourceSerializationInfo.Validate(new ODataResourceSerializationInfo {
                NavigationSourceName = "Set", NavigationSourceKind = EdmNavigationSourceKind.EntitySet
            });

            ArgumentNullException exception = Assert.Throws <ArgumentNullException>(action);

            Assert.Contains("serializationInfo.NavigationSourceEntityTypeName", exception.Message);
        }
 public void ValdatingSerializationInfoShouldAllowIfEntitySetNameNotSetWithEdmUnknownEntitySet()
 {
     ODataResourceSerializationInfo.Validate(new ODataResourceSerializationInfo()
     {
         ExpectedTypeName = "NS.Type",
         IsFromCollection = true,
         NavigationSourceEntityTypeName = "NS.Type",
         NavigationSourceKind           = EdmNavigationSourceKind.UnknownEntitySet,
         NavigationSourceName           = null
     });
 }
 public void ValidatingSerializationInfoShouldAllowExpectedTypeNameNotSet()
 {
     ODataResourceSerializationInfo.Validate(new ODataResourceSerializationInfo {
         NavigationSourceName = "Set", NavigationSourceEntityTypeName = "EntitySetElementTypeName"
     }).Should().NotBeNull();
 }
 public void ValidateNullSerializationInfoShouldReturnNull()
 {
     ODataResourceSerializationInfo.Validate(null).Should().BeNull();
 }
Exemple #6
0
 public void ValidateNullSerializationInfoShouldReturnNull()
 {
     Assert.Null(ODataResourceSerializationInfo.Validate(null));
 }