Exemplo n.º 1
0
        public void BaseFactory_Constructor_Properties()
        {
            var generator = new SimpleObjFaker(null);

            Assert.NotNull(generator);
            Assert.Equal(0, generator.Count);
        }
Exemplo n.º 2
0
        public void BaseFactory_Generate_Override_Output()
        {
            int expectedHash = 1234;
            var generator    = new SimpleObjFaker(null);
            var generated    = generator.Generate(u => u.RuleFor(x => x.Hash, expectedHash));

            Assert.NotNull(generated);
            Assert.IsType <SimpleObj>(generated);
            Assert.Equal(expectedHash, generated.Hash);
        }
Exemplo n.º 3
0
        public void BaseFactory_Generate_Defult_Output()
        {
            var generator    = new SimpleObjFaker(null);
            var generated    = generator.Generate();
            int expectedHash = 1;

            Assert.NotNull(generated);
            Assert.IsType <SimpleObj>(generated);
            Assert.Equal(expectedHash, generated.Hash);
        }
Exemplo n.º 4
0
        public void BaseFactory_Sync_CorrectCall_Count()
        {
            int initialCount = Counter;

            var generator = new SimpleObjFaker(null);

            generator.Generate();
            generator.Generate();

            generator.Sync();

            Assert.Equal(2, Counter - initialCount);
        }
Exemplo n.º 5
0
        public void BaseFactory_AcceptChanges_Sync_CorrectCall_NothingToSync_Count()
        {
            int initialCount = Counter;

            var generator = new SimpleObjFaker(null);

            generator.Generate();
            generator.Generate();
            generator.AcceptChanges();

            generator.Sync();

            Assert.Equal(0, Counter - initialCount);
        }