AddView() публичный Метод

public AddView ( string view, string name, string clientId = null, string tenant = null ) : void
view string
name string
clientId string
tenant string
Результат void
		public void RenderLoginPageWithClientOverride()
		{
			var viewLoader = new InMemoryViewLoader();
			viewLoader.AddView(@"<b>@Model.ClientName</b>", "login");
			viewLoader.AddView(@"<override>@Model.ClientName</override>", "login", "clientid");

			RazorViewService e = new RazorViewService(new TemplateServiceConfiguration { TemplateManager = new IdentityTemplateManager(viewLoader) });

			var str = e.Login(new LoginViewModel { ClientName = "My Client Name" }, new SignInMessage {ClientId = "clientid"}).Result;

			Assert.AreEqual("<override>My Client Name</override>", StreamToString(str));
		}
		public void RenderLoginPageWithLayout()
		{
			var viewLoader = new InMemoryViewLoader();
			viewLoader.AddView("<layout>@RenderBody()</layout>", "myLayout");
			viewLoader.AddView(@"@{this.Layout = @""mylayout"";}<b>@Model.ClientName</b>", "login");

			RazorViewService e = new RazorViewService(new TemplateServiceConfiguration { TemplateManager = new IdentityTemplateManager(viewLoader) });

			var str = e.Login(new LoginViewModel { ClientName = "My Client Name" }, new SignInMessage()).Result;

			Assert.AreEqual("<layout><b>My Client Name</b></layout>", StreamToString(str));
		}