コード例 #1
0
        public void ShouldCreateIncrementElements()
        {
            //Resolve repo
            var repository = _DataSession.ResolveRepository <IPersonRepository>();

            //Get number of elements before create
            var countBefore = _DataSession.GetScenario <IChakraScenario>().Persons.Count;

            //Define new element
            var element = new Person
            {
                Name    = "Jane",
                Surname = "Doe"
            };

            //Execute operation
            repository.Save(element);

            //Get number of elements after create
            var countAfter = _DataSession.GetScenario <IChakraScenario>().Persons.Count;

            //Assert
            Assert.Equal(countBefore + 1, countAfter);
        }