Exemple #1
0
        public void Test_IsValidControl_WhenControlNull_ReturnFailingResult()
        {
            //---------------Set up test pack-------------------
            IControlNamingConvention namingConvention = GetNamingConvention();

            //---------------Assert Precondition----------------
            Assert.IsNotNull(namingConvention);
            //---------------Execute Test ----------------------
            var isValidControl = namingConvention.IsValidControl(null);

            //---------------Test Result -----------------------
            Assert.IsFalse(isValidControl.Successful, "Should be invalid");
            StringAssert.Contains("control cannot be null", isValidControl.Message);
        }
 public HabaneroControlBinder(IControlNamingConvention namingConvention)
 {
     //Pull this into an argument in the Constructor
     // to be able to Inject a different Adaptor Factory e.g. for Infragistics.
     _controlAdaptorFactory = new WinFormsControlAdaptorFactory();
     //Pull this into an argument in the Constructor
     // to be able to Inject a different naming convention.
     _controlNamingConvention = namingConvention;
     //Pull this into an argument in the Constructor
     // to be able to Inject a different Mapper Registry e.g. for Infragistics.
     _controlMapperRegistry    = new WinFormsControlMapperRegistry(_controlNamingConvention);
     ControlMappers            = new ControlMapperCollection();
     _compulsoryFieldIndicator = "*";
 }