Heya Pankaj,
There's a good general approach to unit testing view components you can find here on SO
I've made a varient of that example to include the specifics of the widget properties that are in your question.
[TestMethod]
public void ExampleWidgetPropertiesViewComponentTest() {
// Arrange
var expected = "Title example";
var httpContext = new DefaultHttpContext(); //You can also Mock this
//...then set user and other required properties on the httpContext as needed
var viewContext = new ViewContext();
viewContext.HttpContext = httpContext;
var viewComponentContext = new ViewComponentContext();
viewComponentContext.ViewContext = viewContext;
var viewComponent = new ExampleWidgetViewComponent();
viewComponent.ViewComponentContext = viewComponentContext;
//Create a testing instance of the widget properties as if a CMS editor had applied them.
var widgetProperties = new ExampleWidgetProperties(){
Title = "Title example"
};
//Act
var viewModel = viewComponent.Invoke(widgetProperties).ViewData.Model as ExampleWidgetViewModel;
//Assert
Assert.AreEqual(expected, viewModel.Title);
}