Esempio n. 1
0
        public void CallingTableReturnsRenameTableExpressionBuilder()
        {
            var collectionMock = new Mock <ICollection <IMigrationExpression> >();
            var contextMock    = new Mock <IMigrationContext>();

            contextMock.SetupGet(x => x.Expressions).Returns(collectionMock.Object).AtMostOnce();

            var root    = new RenameExpressionRoot(contextMock.Object);
            var builder = root.Table("Bacon");

            builder.ShouldBeOfType <RenameTableExpressionBuilder>();
            contextMock.VerifyAll();
        }
Esempio n. 2
0
        public void CallingTableAddsRenameTableExpressionToContextWithSpecifiedOldName()
        {
            var collectionMock = new Mock <ICollection <IMigrationExpression> >();

            var contextMock = new Mock <IMigrationContext>();

            contextMock.SetupGet(x => x.Expressions).Returns(collectionMock.Object);

            var root = new RenameExpressionRoot(contextMock.Object);

            root.Table("Bacon");

            collectionMock.Verify(x => x.Add(It.Is <RenameTableExpression>(e => e.OldName.Equals("Bacon"))));
            contextMock.VerifyGet(x => x.Expressions);
        }