|
| 1 | +// <auto-generated/> |
| 2 | +// This code was generated by the library M31.FluentAPI. |
| 3 | +// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. |
| 4 | + |
| 5 | +#nullable enable |
| 6 | + |
| 7 | +using System; |
| 8 | +using M31.FluentApi.Attributes; |
| 9 | + |
| 10 | +namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodDefaultValuesClass; |
| 11 | + |
| 12 | +public class CreateStudent : CreateStudent.IWithLastName, CreateStudent.IBornOn, CreateStudent.IEnrolledIn, CreateStudent.IInSemester, CreateStudent.IWithNumberOfPassedExams, CreateStudent.IWithNumberOfFailedExams |
| 13 | +{ |
| 14 | + private readonly Student student; |
| 15 | + |
| 16 | + private CreateStudent() |
| 17 | + { |
| 18 | + student = new Student(); |
| 19 | + } |
| 20 | + |
| 21 | + public static IWithLastName WithFirstName(string firstName = "Alice") |
| 22 | + { |
| 23 | + CreateStudent createStudent = new CreateStudent(); |
| 24 | + createStudent.student.WithFirstName(firstName); |
| 25 | + return createStudent; |
| 26 | + } |
| 27 | + |
| 28 | + public IBornOn WithLastName(string? lastName = null) |
| 29 | + { |
| 30 | + student.WithLastName(lastName); |
| 31 | + return this; |
| 32 | + } |
| 33 | + |
| 34 | + public IEnrolledIn BornOn(System.DateOnly date = default) |
| 35 | + { |
| 36 | + student.BornOn(date); |
| 37 | + return this; |
| 38 | + } |
| 39 | + |
| 40 | + public IInSemester EnrolledIn(System.DateOnly date = default) |
| 41 | + { |
| 42 | + student.EnrolledIn(date); |
| 43 | + return this; |
| 44 | + } |
| 45 | + |
| 46 | + public IWithNumberOfPassedExams InSemester(int semester = 3) |
| 47 | + { |
| 48 | + student.InSemester(semester); |
| 49 | + return this; |
| 50 | + } |
| 51 | + |
| 52 | + public IWithNumberOfFailedExams WithNumberOfPassedExams(int? numberOfPassedExams = default) |
| 53 | + { |
| 54 | + student.WithNumberOfPassedExams(numberOfPassedExams); |
| 55 | + return this; |
| 56 | + } |
| 57 | + |
| 58 | + public Student WithNumberOfFailedExams(int? numberOfFailedExams = default) |
| 59 | + { |
| 60 | + student.WithNumberOfFailedExams(numberOfFailedExams); |
| 61 | + return student; |
| 62 | + } |
| 63 | + |
| 64 | + public interface IWithLastName |
| 65 | + { |
| 66 | + IBornOn WithLastName(string? lastName = null); |
| 67 | + } |
| 68 | + |
| 69 | + public interface IBornOn |
| 70 | + { |
| 71 | + IEnrolledIn BornOn(System.DateOnly date = default); |
| 72 | + } |
| 73 | + |
| 74 | + public interface IEnrolledIn |
| 75 | + { |
| 76 | + IInSemester EnrolledIn(System.DateOnly date = default); |
| 77 | + } |
| 78 | + |
| 79 | + public interface IInSemester |
| 80 | + { |
| 81 | + IWithNumberOfPassedExams InSemester(int semester = 3); |
| 82 | + } |
| 83 | + |
| 84 | + public interface IWithNumberOfPassedExams |
| 85 | + { |
| 86 | + IWithNumberOfFailedExams WithNumberOfPassedExams(int? numberOfPassedExams = default); |
| 87 | + } |
| 88 | + |
| 89 | + public interface IWithNumberOfFailedExams |
| 90 | + { |
| 91 | + Student WithNumberOfFailedExams(int? numberOfFailedExams = default); |
| 92 | + } |
| 93 | +} |
0 commit comments