-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from DigDes/develop
v1.1.0.2-alpha
- Loading branch information
Showing
27 changed files
with
1,069 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SoapCore.Tests.Model | ||
{ | ||
[KnownType(typeof(ComplexInheritanceModelInputB))] | ||
[DataContract(Name = "ComplexInheritanceModelInputA")] | ||
public class ComplexInheritanceModelInputA : ComplexInheritanceModelInputBase | ||
{ | ||
[DataMember] | ||
public override string Example { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SoapCore.Tests.Model | ||
{ | ||
[DataContract(Name = "ComplexInheritanceModelInputB")] | ||
public class ComplexInheritanceModelInputB : ComplexInheritanceModelInputA | ||
{ | ||
[DataMember] | ||
public int Example2 { get; set; } | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/SoapCore.Tests/Model/ComplexInheritanceModelInputBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SoapCore.Tests.Model | ||
{ | ||
[KnownType(typeof(ComplexInheritanceModelInputA))] | ||
[KnownType(typeof(ComplexInheritanceModelInputB))] | ||
[DataContract(Name = "ComplexInheritanceModelInputBase")] | ||
public abstract class ComplexInheritanceModelInputBase | ||
{ | ||
[DataMember] | ||
public string StringProperty { get; set; } | ||
|
||
[DataMember] | ||
public abstract string Example { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace SoapCore.Tests.Wsdl.Services | ||
{ | ||
public class CustomDictionary : Dictionary<string, string> | ||
{ | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
src/SoapCore.Tests/Wsdl/Services/IAnonymousServiceKnownTypesService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
using System.ServiceModel; | ||
|
||
namespace SoapCore.Tests.Wsdl.Services | ||
{ | ||
[ServiceKnownType(typeof(AnonymousServiceKnownTypesService.Dog))] | ||
[ServiceContract] | ||
public interface IAnonymousServiceKnownTypesService | ||
{ | ||
[ServiceKnownType(typeof(AnonymousServiceKnownTypesService.Cat))] | ||
[OperationContract] | ||
object TestFromTypedToAny(AnonymousServiceKnownTypesService.Animal value); | ||
|
||
[ServiceKnownType(typeof(AnonymousServiceKnownTypesService.Squirrel))] | ||
[OperationContract] | ||
AnonymousServiceKnownTypesService.Animal TestFromAnyToTyped(object value); | ||
} | ||
|
||
public class AnonymousServiceKnownTypesService : IAnonymousServiceKnownTypesService | ||
{ | ||
public object TestFromTypedToAny(Animal value) | ||
{ | ||
return value; | ||
} | ||
|
||
public Animal TestFromAnyToTyped(object value) | ||
{ | ||
if (value is null) | ||
{ | ||
throw new ArgumentNullException(nameof(value)); | ||
} | ||
|
||
if (value is Animal result) | ||
{ | ||
return result; | ||
} | ||
|
||
throw new Exception($"Object of type `{value.GetType()}` is not supported in this context."); | ||
} | ||
|
||
[DataContract(Name = "Animal")] | ||
public class Animal | ||
{ | ||
} | ||
|
||
[DataContract(Name = "Dog")] | ||
public class Dog : Animal | ||
{ | ||
} | ||
|
||
[DataContract(Name = "Cat")] | ||
public class Cat : Animal | ||
{ | ||
} | ||
|
||
[DataContract(Name = "Squirrel")] | ||
public class Squirrel : Animal | ||
{ | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/SoapCore.Tests/Wsdl/Services/IDictionaryTypeListService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ServiceModel; | ||
using SoapCore.Tests.Model; | ||
|
||
namespace SoapCore.Tests.Wsdl.Services | ||
{ | ||
[ServiceContract] | ||
public interface IDictionaryTypeListService | ||
{ | ||
[OperationContract] | ||
List<ComplexModelInput> Test(); | ||
|
||
[OperationContract] | ||
Dictionary<string, string> DictionaryTest(Dictionary<string, string> thing); | ||
} | ||
|
||
public class DictionaryTypeListService : IDictionaryTypeListService | ||
{ | ||
public Dictionary<string, string> DictionaryTest(Dictionary<string, string> thing) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public List<ComplexModelInput> Test() => throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Runtime.Serialization; | ||
using System.ServiceModel; | ||
|
||
namespace SoapCore.Tests.Wsdl.Services | ||
{ | ||
[ServiceContract] | ||
public interface IInheritanceService | ||
{ | ||
[OperationContract] | ||
InheritanceService.Animal Test(); | ||
} | ||
|
||
public class InheritanceService : IInheritanceService | ||
{ | ||
public Animal Test() | ||
{ | ||
return new Dog | ||
{ | ||
Name = "Test", | ||
}; | ||
} | ||
|
||
[KnownType(typeof(Dog))] | ||
[DataContract(Name = "Animal")] | ||
public abstract class Animal | ||
{ | ||
[DataMember] | ||
public string Name { get; set; } | ||
} | ||
|
||
[DataContract(Name = "Dog")] | ||
public class Dog : Animal | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.