Esempio n. 1
0
        public async Task GetStock(TestContextFixture testContextFixture, Stock stock, GetStock.Query getStock)
        {
            //arrange
            testContextFixture.SaveAll(stock);
            getStock.CurrencyCode = stock.CurrencyCode;
            getStock.IsinCode     = stock.IsinCode;

            //act
            var result = await testContextFixture.SendAsync(getStock);

            //assert
            result.Name.ShouldBe(stock.Name);
        }
        public void Should_create(TestContextFixture fixture, Department dept)
        {
            fixture.SaveAll(dept);

            var command = new Create.Command
            {
                Title      = "Blarg",
                Credits    = 10,
                Department = dept
            };

            fixture.Send(command);

            Course course = null;

            fixture.DoClean(ctx => course = ctx.Set <Course>().FirstOrDefault(c => c.Title == command.Title));

            course.Title.ShouldBe(command.Title);
            course.Credits.ShouldBe(command.Credits);
            course.DepartmentID.ShouldBe(dept.DepartmentID);
        }
Esempio n. 3
0
        public void Should_create(TestContextFixture fixture, Department dept)
        {
            fixture.SaveAll(dept);

            var command = new Create.Command
            {
                Title = "Blarg",
                Credits = 10,
                Department = dept
            };

            fixture.Send(command);

            Course course = null;

            fixture.DoClean(ctx => course = ctx.Set<Course>().FirstOrDefault(c => c.Title == command.Title));

            course.Title.ShouldBe(command.Title);
            course.Credits.ShouldBe(command.Credits);
            course.DepartmentID.ShouldBe(dept.DepartmentID);
        }
Esempio n. 4
0
 public void Should_SaveEntity(TestContextFixture testContextFixture, Stock stock)
 {
     testContextFixture.SaveAll(stock);
 }