This file contains hidden or 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 virtual ActionResult SiteMap() | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
var controllers = assembly.GetTypes().Where(x => x != typeof(BaseController) && typeof(BaseController).IsAssignableFrom(x)).ToList(); | |
controllers = controllers.Where(c => !c.Name.StartsWith("T4MVC")).ToList(); | |
var controller = controllers.FirstOrDefault(c => c.FullName.Contains("HomePage")); | |
var actions = GetActionResults(controller); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net.Http; | |
namespace PackageUploader.Azure | |
{ | |
public class AzureStorageApi | |
{ | |
public void UploadFile(String fullFilePath, String blobSasUri, Dictionary<String, String> metadata = null) |
This file contains hidden or 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
using System; | |
using System.Collections.Specialized; | |
using System.IO; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
using System.Web.Configuration; | |
using System.Web.Hosting; | |
using System.Web.SessionState; |
This file contains hidden or 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"?> | |
<!-- | |
This file is used by the publish/package process of your Web project. You can customize the behavior of this process | |
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. | |
--> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<PackagePath Condition=" '$(PackagePath)'=='' ">website</PackagePath> | |
<EnableAddReplaceToUpdatePacakgePath Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='' ">true</EnableAddReplaceToUpdatePacakgePath> |
This file contains hidden or 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 AzureStorageApi | |
{ | |
private const string AzureApiVersion = "2012-02-12"; | |
private const int BlockSize = 4 * 1024 * 1024; | |
public void UploadFile(string fullFilePath, string blobSasUri, Dictionary<string, string> metadata = null, int timeout = 60) | |
{ | |
var blocks = new List<String>(); | |
var tasks = new List<Task>(); |
This file contains hidden or 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 CreateLocationAddressCommandHandlerTests | |
{ | |
private IFixture fixture; | |
[SetUp] | |
public void SetUp() | |
{ | |
fixture = new Fixture().Customize(new AutofixtureOnboardCustomization()) | |
.Customize(new IgnoreVirtualMembersCustomisation()); |
This file contains hidden or 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
[Theory, AutoDomainData] | |
public void FrozenObjects_AreInjected_IntoSut([Frozen]ILocationAddressRepository repository, | |
CreateLocationAddressCommandHandler sut, CreateLocationAddressCommand command) | |
{ | |
// Act | |
sut.Handle(command); | |
// Assert | |
repository.Received().Insert(Arg.Any<LocationAddress>()); | |
repository.Received().Save(); |
This file contains hidden or 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
// Issue with this approach is when there is nothing is wrong with the solution and no actions are in the bad, i.e. test should pass | |
// this test still fail with error saying "No data found". | |
public class ControllerActionsDataAttribute : DataAttribute | |
{ | |
public override IEnumerable<object[]> GetData(MethodInfo methodUnderTest, Type[] parameterTypes) | |
{ | |
var controllerTypes = SitemapControllersTests.GetControllerTypes(); | |
var offendingActions = controllerTypes.Where(ct => !SitemapControllersTests.ExcludedControllers.Contains(ct)) | |
.SelectMany(c => c.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) |
This file contains hidden or 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
using System; | |
using System.Web.Mvc; | |
public class RequreSecureConnectionFilter : RequireHttpsAttribute | |
{ | |
public override void OnAuthorization(AuthorizationContext filterContext) | |
{ | |
if (filterContext == null) | |
{ |
This file contains hidden or 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 xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |
<system.web> | |
<compilation xdt:Transform="RemoveAttributes(debug)" /> | |
<httpCookies httpOnlyCookies="true" requireSSL="true" lockItem="true" xdt:Transform="Replace" /> | |
<authentication mode="Forms"> | |
<forms loginUrl="~/Logon/LogOn" timeout="2880" requireSSL="true" xdt:Transform="Replace"/> | |
</authentication> | |
</system.web> |
OlderNewer