コード例 #1
0
 public Product Product()
 {
     return(new Product
     {
         Id = GetUniqueId(),
         Name = ARandom.Title(30),
         Description = ARandom.Text(200)
     });
 }
コード例 #2
0
ファイル: ARandomTests.cs プロジェクト: roelvdwater/Fluency
 public void should_generate_a_string_of_up_to_the_specified_size_string(int length)
 {
     ARandom.Title(length).Length.Should().BeInRange(1, length);
 }
コード例 #3
0
ファイル: ARandomTests.cs プロジェクト: roelvdwater/Fluency
            public void should_not_allow_max_chars_less_than_1()
            {
                Action randomTitleOfZero = () => { ARandom.Title(0); };

                randomTitleOfZero.ShouldThrow <ArgumentOutOfRangeException>();
            }
コード例 #4
0
ファイル: ARandomTests.cs プロジェクト: roelvdwater/Fluency
 public void should_return_a_nonempty_string()
 {
     ARandom.Title(100).Should().NotBeEmpty();
 }
コード例 #5
0
 protected override void SetupDefaultValues()
 {
     SetProperty(x => x.Id, GenerateNewId());
     SetProperty(x => x.Name, ARandom.Title(100));
     SetProperty(x => x.Description, ARandom.Text(200));
 }