Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
Release 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek authored Sep 20, 2019
2 parents c82a2de + cc685a7 commit 49593b8
Show file tree
Hide file tree
Showing 17 changed files with 538 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace MappingGenerator.Test.MappingGenerator.TestCaseData
Birthday = entity.Birthday,
Authentication = entity.Authentication,
SecondAuthentication = entity.SecondAuthentication.ToString(),
ThirdAuthentication = Enum.Parse(typeof(AuthenticationKind), entity.ThirdAuthentication, true),
ThirdAuthentication = (AuthenticationKind)Enum.Parse(typeof(AuthenticationKind), entity.ThirdAuthentication, true),
FourthAuthentication = (int?)entity.FourthAuthentication,
FifthAuthentication = (AuthenticationKind?)entity.FifthAuthentication
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,19 @@
<data name="_001_SuggestOuterMethodParameters" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\001_SuggestOuterMethodParameters.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="_002_SuggestOuterMethodParametersAndLocal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\002_SuggestOuterMethodParametersAndLocal.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="_003_SuggestOuterMethodParametersAndMembers" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\003_SuggestOuterMethodParametersAndMembers.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="_004_FallbackByTypeIfSingleCandidate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\004_FallbackByTypeIfSingleCandidate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="_005_FallbackByTypeIfSingleCandidateInterface" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\005_FallbackByTypeIfSingleCandidateInterface.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="_006_FallbackByTypeIfSingleCandidateBaseClass" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>TestCaseData\006_FallbackByTypeIfSingleCandidateBaseClass.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MappingGenerator.Test.MethodParameterSuggestion
public class MethodParametersSuggestionProviderTest: CompletionProviderFixture
{
[Test]
public void should_be_able_to_get_completion()
public void should_be_able_to_get_completion_with_outer_method_parameters()
{
TestCompletion(MethodParameterSuggestionTestCases._001_SuggestOuterMethodParameters, new []
{
Expand All @@ -17,6 +17,56 @@ public void should_be_able_to_get_completion()
});
}

[Test]
public void should_be_able_to_get_completion_with_outer_method_parameters_and_local()
{
TestCompletion(MethodParameterSuggestionTestCases._002_SuggestOuterMethodParametersAndLocal, new []
{
"firstName, lastName, age, parent",
"firstName:firstName, lastName:lastName, age:age, parent:parent"
});
}

[Test]
public void should_be_able_to_get_completion_with_outer_method_parameters_and_outer_type_members()
{
TestCompletion(MethodParameterSuggestionTestCases._003_SuggestOuterMethodParametersAndMembers, new []
{
"firstName, lastName, age, parent",
"firstName:firstName, lastName:lastName, age:age, parent:parent"
});
}

[Test]
public void should_be_able_to_get_completion_with_variables_that_match_only_type_when_single_candidate()
{
TestCompletion(MethodParameterSuggestionTestCases._004_FallbackByTypeIfSingleCandidate, new []
{
"firstName, lastName, age, firstParent",
"firstName:firstName, lastName:lastName, age:age, parent:firstParent"
});
}

[Test]
public void should_be_able_to_get_completion_with_variables_that_match_only_type_when_single_candidate_by_interface()
{
TestCompletion(MethodParameterSuggestionTestCases._005_FallbackByTypeIfSingleCandidateInterface, new []
{
"firstName, lastName, age, firstParent",
"firstName:firstName, lastName:lastName, age:age, parent:firstParent"
});
}

[Test]
public void should_be_able_to_get_completion_with_variables_that_match_only_type_when_single_candidate_by_base_class()
{
TestCompletion(MethodParameterSuggestionTestCases._005_FallbackByTypeIfSingleCandidateInterface, new []
{
"firstName, lastName, age, firstParent",
"firstName:firstName, lastName:lastName, age:age, parent:firstParent"
});
}


protected override string LanguageName => LanguageNames.CSharp;
protected override CompletionProvider CreateProvider()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace MappingGenerator.Test.MappingGenerator.TestCaseData
{
public class TestMapper
{
public static UserDTO Map(string firstName, string lastName, int age)
{
var parent = new UserDTO();
Map2([||]);
}

public static UserDTO Map2(string firstName, string lastName, int age, UserDTO parent)
{

}
}

public class UserDTO
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace MappingGenerator.Test.MappingGenerator.TestCaseData
{
public class TestMapper
{
private readonly UserDTO parent = new UserDTO();

public static UserDTO Map(string firstName, string lastName, int age)
{
Map2([||]);
}

public static UserDTO Map2(string firstName, string lastName, int age, UserDTO parent)
{

}
}

public class UserDTO
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace MappingGenerator.Test.MappingGenerator.TestCaseData
{
public class TestMapper
{
public static UserDTO Map(string firstName, string lastName, int age)
{
var firstParent = new UserDTO();
Map2([||]);
}

public static UserDTO Map2(string firstName, string lastName, int age, UserDTO parent)
{

}
}

public class UserDTO
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace MappingGenerator.Test.MappingGenerator.TestCaseData
{
public class TestMapper
{
IUserDTO firstParent = new UserDTO();

public static UserDTO Map(string firstName, string lastName, int age)
{
Map2([||]);
}

public static UserDTO Map2(string firstName, string lastName, int age, IUserDTO parent)
{

}
}

public interface IUserDTO {}

public class UserDTO:IUserDTO
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace MappingGenerator.Test.MappingGenerator.TestCaseData
{
public class TestMapper
{
EntityDTO firstParent = new UserDTO();

public static UserDTO Map(string firstName, string lastName, int age)
{
Map2([||]);
}

public static UserDTO Map2(string firstName, string lastName, int age, EntityDTO parent)
{

}
}

public class EntityDTO {}

public class UserDTO:EntityDTO
{

}
}
Loading

0 comments on commit 49593b8

Please sign in to comment.