public void ContractNotesLogicConstructorTest1()
        {
            var mockAddEditContractNote = new Mock <IContractNoteRepository>();
            ContractNoteLogic target    = new ContractNoteLogic(mockAddEditContractNote.Object);

            Assert.IsInstanceOfType(target, typeof(ContractNoteLogic));
        }
        public void ContractNotesLogicConstructorTest()
        {
            var target = new ContractNoteLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(ContractNoteLogic));
        }
Пример #3
0
        /// <summary>
        /// Prevents a default instance of the <see cref="ContractNoteController"/> class from being created.
        /// </summary>
        ContractNoteController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _contractLogic = new ContractNoteLogic(bubbleDataSource);
        }
        public void AddEditContractNoteIfNull()
        {
            var mockAddEditContractNote = new Mock <IContractNoteRepository>();

            mockAddEditContractNote.Setup(f => f.AddEditContractNote(It.IsAny <ContractNote>())).Returns(new ContractNote {
                ContractNoteId = 1
            });
            ContractNoteLogic target = new ContractNoteLogic(mockAddEditContractNote.Object);

            ContractNote actual = target.AddEditContractNote(null);

            Assert.IsNotNull(actual);
        }
        public void DeleteContractNoteByIdMockTest1()
        {
            var          mockDeleteContractNoteById = new Mock <IContractNoteRepository>();
            ContractNote objDeleteContractNotes     = new ContractNote {
                ContractNoteId = 1, UserName = "******"
            };

            mockDeleteContractNoteById.Setup(f => f.DeleteContractNote(objDeleteContractNotes)).Returns(true);
            ContractNoteLogic target = new ContractNoteLogic(mockDeleteContractNoteById.Object);

            bool actual = target.DeleteContractNote(objDeleteContractNotes);

            Assert.AreEqual(true, actual);
        }