示例#1
0
        public void Create()
        {
            var before = new NonUnifiedGoods(this.Session).Extent().ToArray();

            var internalOrganisation = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var expected             = new NonUnifiedGoodBuilder(this.Session).WithSerialisedDefaults(internalOrganisation).Build();

            var expectedPart = new NonUnifiedParts(this.Session).Extent().First;

            this.Session.Derive();

            var expectedName        = expected.Name;
            var expectedDescription = expected.Description;
            var expectedPartName    = expectedPart.Name;

            var nonUnifiedGoodCreate = this.goods.CreateNonUnifiedGood();

            nonUnifiedGoodCreate
            .Name.Set(expected.Name)
            .Description.Set(expected.Description)
            .Part.Select(expectedPart.Name);

            this.Session.Rollback();
            nonUnifiedGoodCreate.SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new NonUnifiedGoods(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var good = after.Except(before).First();

            Assert.Equal(expectedName, good.Name);
            Assert.Equal(expectedDescription, good.Description);
            Assert.Equal(expectedPartName, good.Part.Name);
        }
示例#2
0
        public void Create()
        {
            var before = new NonUnifiedGoods(this.Session).Extent().ToArray();

            var page = this.goods.NewNonUnifiedGood();

            page.Name.Set("Mercedes Vito")
            .Description.Set("Vans. Born to run.")
            .Part.Set("finished good")
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new NonUnifiedGoods(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var good = after.Except(before).First();

            Assert.Equal("Mercedes Vito", good.Name);
            Assert.Equal("Vans. Born to run.", good.Description);
            Assert.Equal("finished good", good.Part.Name);
        }