Question: I have to write a test case for which I have to mock a method with below signature:

```
public X testMethod(String[] args);

```

Now the scenario I have to simulate is:

```
when(xyz.testMethod(
                       // args contains "AAA" and "BBB"
                   ).thenReturn(x1);

when(xyz.testMethod(
                       // args contains "CCC" and "DDD"
                   ).thenReturn(x2);

```

Not getting a pointer, how can I simulate this scenario

Answer: 
The better question, here, is why are you storing your dates as a `varchar`. **Don't**. There are SO many reasons why you shouldn't, and I honestly don't know any good ones for why you should.

As a quick example, the "date" `'31-01-2000'` is **after** the date `'09-12-2017'` in `varchar` terms. So a query with `WHERE [varcharDateColumn] <= '09-12-2017'` won't return items from the first above date. you'd therefore have to use a `CONVERT`/`CAST`, which means you can't use any indexes you have. 

For what you have, the correct code will (likely) be :

```
LEFT(DATENAME(MONTH,TRY_CONVERT(date,[Date])),3)

```

However, I strongly suggest you fix your datatypes, then there is no need for the use of the `TRY_CONVERT`.
Try this:

```
--successfully converts date in dd-mm-yyyy fromat, stored as string
select parse('29-12-2017' as date using 'en-GB')
--displays three-letter abbreviation of month
select FORMAT(parse('29-12-2017' as date using 'en-GB'), 'MMM') --> will return Dec

```

So, just replace passed string `'29-12-2017'` with your column name and it should work :)

NOTE: `PARSE` function is available in SQL Server 2012 onwards.