Пример #1
0
        public void ShouldConfigurePropertiesProperlyOnConstructorAndReturnsObjectOnCreateInstance()
        {
            Mock <IQuantityAnalysisResultFactory> quantityAnalysisResultFactoryMock = new Mock <IQuantityAnalysisResultFactory>();
            QuantityAnalysisFactory quantityAnalysisFactory = new QuantityAnalysisFactory(quantityAnalysisResultFactoryMock.Object);

            int min = 100;
            int max = 200;

            Mock <IQuantitySearch> quantitySearchMock = new Mock <IQuantitySearch>();
            List <IQuantitySearch> quantitySearchList = new List <IQuantitySearch>()
            {
                quantitySearchMock.Object
            };

            IQuantityAnalysis quantityAnalysis = quantityAnalysisFactory.CreateInstance(min, max, quantitySearchList);

            Assert.AreEqual(quantityAnalysis.QuantitySearchList, quantitySearchList);
            Assert.AreEqual(quantityAnalysis.Min, min);
            Assert.AreEqual(quantityAnalysis.Max, max);
        }
Пример #2
0
        public void ShouldThrowExceptionWhenIsNotConfiguredProperly()
        {
            QuantityAnalysisFactory quantityAnalysisFactory = new QuantityAnalysisFactory();

            quantityAnalysisFactory.CreateInstance(null, null, null);
        }