Beispiel #1
0
        public void ListFeedbacksAsString_WhenInvoked()
        {
            //arrange
            var context = new Mock <IStoreContext>();
            var writer  = new Mock <IWriter>();
            var reader  = new Mock <IReader>();

            string productName = "testproduct";

            Product testproduct1      = new Product();
            Product testproduct2      = new Product();
            Product testProductObject = new Product(); //no need from mock, because it contains no logic

            testProductObject.ProductName = productName;

            List <Product> productCollection = new List <Product>()
            {
                testProductObject, testproduct1, testproduct2
            };

            var productsInDbMock = new Mock <DbSet>();

            //productsInDbMock.Setup(x => x.)

            //context.Setup(x => x.Products).Returns(productCollection);

            ICommand listFeedbacks = new ListFeedbacksCommand(context.Object, writer.Object, reader.Object);

            //act


            //assert
        }
        public void CreateInstance_WhenConstructorsArgumentsAreNotNull()
        {
            //arrange
            var context = new Mock <IStoreContext>();
            var writer  = new Mock <IWriter>();
            var reader  = new Mock <IReader>();

            //act
            var testcommand = new ListFeedbacksCommand(context.Object, writer.Object, reader.Object);

            //assert
            Assert.IsNotNull(testcommand);
        }