コード例 #1
0
ファイル: Visa.cs プロジェクト: AlexTorianyk/valenia
 public void UpdateRequirementExample(RequirementId requirementId, RequirementExample example)
 {
     Apply(new RequirementEvents.ExampleChanged
     {
         Id      = requirementId,
         Example = example
     });
 }
コード例 #2
0
ファイル: VisaTests.cs プロジェクト: AlexTorianyk/valenia
            public void ThrowException_ValidRequirementButExpectedProcessingTimeNotSet()
            {
                // Arrange
                const VisaType type                   = VisaType.D;
                var            visa                   = new Visa(type);
                var            requirementName        = RequirementName.FromString("Invitation Letter");
                var            requirementDescription =
                    RequirementDescription.FromString("A letter of acceptance from a foreign university.");
                var requirementExample = RequirementExample.FromString("acceptance_letter_example.png");

                // Act & Assert
                Assert.Throws <Exceptions.InvalidEntityState>(() =>
                                                              visa.AddRequirement(requirementName, requirementDescription, requirementExample));
            }
コード例 #3
0
ファイル: VisaTests.cs プロジェクト: AlexTorianyk/valenia
            public void AddRequirement_ValidRequirementAndExpectedProcessingTimeSet()
            {
                // Arrange
                const VisaType type                   = VisaType.D;
                var            visa                   = new Visa(type);
                var            requirementName        = RequirementName.FromString("Invitation Letter");
                var            requirementDescription =
                    RequirementDescription.FromString("A letter of acceptance from a foreign university.");
                var requirementExample = RequirementExample.FromString("acceptance_letter_example.png");

                visa.SetExpectedProcessingTime(VisaExpectedProcessingTime.FromInt(30));

                // Act
                visa.AddRequirement(requirementName, requirementDescription, requirementExample);

                //Assert
                Assert.NotEmpty(visa.Requirements);
            }
コード例 #4
0
ファイル: Visa.cs プロジェクト: AlexTorianyk/valenia
 public void AddRequirement(RequirementName name, RequirementDescription description, RequirementExample example)
 {
     Apply(new RequirementEvents.AddedToVisa
     {
         RequirementId = Guid.NewGuid(),
         VisaId        = Id,
         Name          = name,
         Description   = description,
         Example       = example
     });
 }