benjaminvr

Test response dto's

Nov 3rd, 2021 (edited)
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. public interface IResponseDTO {
  2.     string Naam { get; }
  3. }
  4.  
  5. public class NestedResponseDTO {
  6.     private Random rnd = new();
  7.     private string _naam;
  8.     private string _naamvoorspelbaar;
  9.     private TestResponseDTO _testresponsedto;
  10.  
  11.     public NestedResponseDTO(TestResponseDTO testresponsedto=null) {
  12.         _naam = "NestedNaam" + rnd.Next(int.MinValue, int.MaxValue).ToString();
  13.         _naamvoorspelbaar = rnd.Next(0, 100) <= 50 ? "Vincent" : "John";
  14.         _testresponsedto = testresponsedto;
  15.     }
  16.  
  17.     public string Naam => _naam;
  18.     public string NaamVoorspelbaar => _naamvoorspelbaar;
  19.     public TestResponseDTO CirculaireRelatieDTO => _testresponsedto;
  20. }
  21.  
  22. public class TestResponseDTO {
  23.     private Random rnd = new();
  24.     private string _naam;
  25.     private string _naamvoorspelbaar;
  26.     private NestedResponseDTO _nestedrespdto;
  27.  
  28.     public TestResponseDTO() {
  29.         _naam = "Naam" + rnd.Next(int.MinValue, int.MaxValue).ToString();
  30.         _naamvoorspelbaar = rnd.Next(0, 100) <= 50 ? "Henk" : "Jos";
  31.         _nestedrespdto = new NestedResponseDTO(this);
  32.     }
  33.  
  34.     public string Naam => _naam;
  35.     public string NaamVoorspelbaar => _naamvoorspelbaar;
  36.     public NestedResponseDTO GenesteDTO => _nestedrespdto;
  37. }
Add Comment
Please, Sign In to add comment