This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This utility is build using Nunit framework like other NUnit tests. | |
// My main goal of this utility is, | |
// if there is any exceptions then I have to fail my unit test. | |
// for any if conditions, instead of using a if...else, I have to fail my unit test. | |
// To achieve this, I am using Assert.Fail where ever necessary. Like few sample'e are below. | |
//if(value == null) | |
//{ | |
//Assert.Fail("Value cannot be null in this case"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Session | |
{ | |
private List<UseCase> useCaseList; | |
public void ExecuteSession() | |
{ | |
foreach(var useCase in useCaseList) | |
{ | |
useCase.ExecuteUseCase(); | |
// Probelm is here. The next use case starts executing before completion of the previous use-case. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IMediatorMessage | |
{ | |
} | |
interface IMessageHandler<T> where T : IMediatorMessage | |
{ | |
void Handle(T message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object which should be returned as out parameter from another mock object | |
var mockedObject = MockRepository.GenerateMock<IRealTimeData>(); | |
mockedObject.Expect(x => x.HeatValue).Return(30); | |
// Mock object which has method GetRealTimeData(out var ...) with out params as IRealTimeData | |
serverMockObject.Expect(x => x.GetRealTimeData(out _)).OutRef(mockedObject).Return(true); | |
var actualValue = serice.GetHeatValue(); | |
// Inside the implementation of above method, see below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BarControl | |
{ | |
public Brush BarBrush { get; set; } | |
public double BarHeight { get; set; } | |
public int BarValue { get; set; } | |
public double BarWidth { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style TargetType="{x:Type local:StagedProgressBar}"> | |
<Setter Property="BorderBrush" Value="Black"></Setter> | |
<Setter Property="BorderThickness" Value="1"></Setter> | |
<Setter Property="Foreground" Value="Black"></Setter> | |
<Setter Property="Background" Value="#e6e6e6"></Setter> | |
<Setter Property="Border.CornerRadius" Value="5"></Setter> | |
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter> | |
<Setter Property="VerticalContentAlignment" Value="Center"></Setter> | |
<Setter Property="Template"> | |
<Setter.Value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void WmGetMinMaxInfo(IntPtr hwnd, IntPtr lParam) | |
{ | |
MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO)); | |
int MONITOR_DEFAULTTONEAREST = 0x00000002; | |
IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); | |
if (monitor != IntPtr.Zero) | |
{ | |
MONITORINFO monitorInfo = new MONITORINFO(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(Response)); | |
using (StringReader sr = new StringReader(categories)) | |
{ | |
var result = ser.Deserialize(sr); | |
} | |
[Serializable, XmlRoot("response")] | |
public class Response | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DataGrid Grid.Row="1" x:Name="DataGrid" HorizontalAlignment="Left" VerticalAlignment="Top" ItemsSource="{Binding PersonDetails}"> | |
<!--<DataGrid.Resources> | |
<local:OneReturnsTrueConverter x:Key="OneReturnsTrueConverter"/> | |
<ContextMenu x:Key="DataRowContextMenu"> | |
<MenuItem x:Name="RowContMenuProp" Header="Properties" | |
DataContext="{Binding Parent.PlacementTarget.Tag , RelativeSource={RelativeSource Self}}" | |
IsEnabled="{Binding Path=IsMarried, Converter={StaticResource OneReturnsTrueConverter}}" /> | |
</ContextMenu> | |
</DataGrid.Resources>--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration > | |
<add key="Mode" value="NoMode"/> | |
</configuration> |
NewerOlder