Пример #1
0
 public void GetPriceThrowsArgumentNullException()
 {
     try
     {
         CostManager costManager = new CostManager();
         Money       result      = costManager.GetPrice(null);
     }
     catch (ArgumentNullException ex)
     {
         Assert.True(ex is ArgumentNullException);
     }
 }
Пример #2
0
        public void GetPriceReturnsValidCost()
        {
            Car car = new Car();

            car.Arrival   = new DateTime(2018, 06, 08, 10, 00, 00);
            car.Departure = new DateTime(2018, 06, 08, 22, 00, 00);

            CostManager costManager = new CostManager();
            Money       result      = costManager.GetPrice(car);

            Assert.NotNull(result);
            Assert.Equal(120, result.Value);
        }
Пример #3
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 3 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"

            ViewData["Title"] = "User Profile";
            CostManager costManager = new CostManager();

#line default
#line hidden
            BeginContext(185, 58, true);
            WriteLiteral("\n<div class=\"row\">\n    <h4 class=\"teal-text center-align\">");
            EndContext();
            BeginContext(244, 15, false);
#line 10 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
            Write(Model.FirstName);

#line default
#line hidden
            EndContext();
            BeginContext(259, 57, true);
            WriteLiteral("\'s Profile</h4>\n    <div class=\"col l6 m12 s12\">\n        ");
            EndContext();
            BeginContext(316, 1774, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c0e1f34739cc436a94b740b138af0b8d", async() => {
                BeginContext(399, 235, true);
                WriteLiteral("\n            <div class=\"card #ffffff white\">\n                <div class=\"card-content\">\n                    <span class=\"card-title indigo-text\">Order a Car</span>\n                    <div class=\"input-field\">\n                        ");
                EndContext();
                BeginContext(634, 66, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "dc81cb89a9c0417c8ddb9474ba698087", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.SelectTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper);
#line 17 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.SelectedCar);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line 17 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items = Model.CarItems;

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-items", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(700, 233, true);
                WriteLiteral("\n                    </div>\n                    <span class=\"card-title indigo-text\">Parkings:</span>\n                    <div class=\"row\">\n                        <div class=\"input-field col l6 m12 s12\">\n                            ");
                EndContext();
                BeginContext(933, 103, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "540315730c314fce9e03fd55465f817d", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.SelectTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
#line 22 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.SelectedParking);

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-for", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line 22 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items = Model.ParkingItems;

#line default
#line hidden
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-items", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1036, 490, true);
                WriteLiteral(@"
                        </div>
                        <div class=""col l6 m12 s12"">
                            <a style=""margin-top:2rem;"" class=""waves-effect waves-light btn-small"" onclick=""findLocation()"">Find Nearest</a>
                        </div>
                    </div>
                    <div id=""map"" style=""height:15rem;""></div>
                    <p style=""margin-top:3vh; text-align:right;""><button type=""submit"" class=""btn waves-effect waves-light"">Order</button></p>
");
                EndContext();
#line 30 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                if (TempData["SuccessMessage"] != null)
                {
#line default
#line hidden
                    BeginContext(1609, 401, true);
                    WriteLiteral(@"                        <button style=""display:none;"" id=""orderTrigger"" data-target=""OrderModal"" class=""btn modal-trigger"">Trigger</button>
                        <script type=""text/javascript"">

                            window.onload = function () {
                                document.getElementById(""orderTrigger"").click();
                            }

                        </script>
");
                    EndContext();
#line 40 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                }

#line default
#line hidden
                BeginContext(2033, 50, true);
                WriteLiteral("                </div>\n            </div>\n        ");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_2.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
            __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_3.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(2090, 1858, true);
            WriteLiteral(@"
    </div>
    <div class=""col l6 m12 s12"">
        <div class=""card"">
            <div class=""card-content"">
                <span class=""card-title indigo-text"">Statistics</span>
            </div>
            <div class=""card-tabs"">
                <ul class=""tabs tabs-fixed-width"">
                    <li class=""tab""><a href=""#tab1"">Week</a></li>
                    <li class=""tab""><a class=""active"" href=""#tab2"">Month</a></li>
                    <li class=""tab""><a href=""#tab3"">Year</a></li>
                </ul>
            </div>
            <div class=""card-content grey lighten-4"">
                <div id=""tab1"">
                    <p>Average amount: 1</p>
                    <p>Number of parking: 1</p>
                    <p>Average duration: 1</p>
                    <p>SOME CHART</p>
                </div>
                <div id=""tab2"">
                    <p>Average amount: 2</p>
                    <p>Number of parking: 2</p>
                    <p>Average duration: 2</p>
                    <p");
            WriteLiteral(@">SOME CHART</p>
                </div>
                <div id=""tab3"">
                    <p>Average amount: 3</p>
                    <p>Number of parking: 3</p>
                    <p>Average duration: 3</p>
                    <p>SOME CHART</p>
                </div>
            </div>
        </div>
    </div>


</div>
<div class=""row"">
    <div class=""col l6 m12 s12"">
        <div class=""card #ffffff white"">
            <div class=""card-content"">
                <span class=""card-title indigo-text"">In Progress</span>
                <table>
                    <thead>
                        <tr>
                            <th>Car</th>
                            <th>Amount to pay</th>
                            <th>Parking</th>
                        </tr>
                    </thead>
                    <tbody>
");
            EndContext();
#line 97 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
            foreach (Car car in Model.Cars)
            {
                Money money = costManager.GetPrice(car);

#line default
#line hidden
                BeginContext(4100, 69, true);
                WriteLiteral("                            <tr>\n                                <td>");
                EndContext();
                BeginContext(4170, 15, false);
#line 101 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                Write(car.StateNumber);

#line default
#line hidden
                EndContext();
                BeginContext(4185, 51, true);
                WriteLiteral("</td>\n                                <td class=\"\">");
                EndContext();
                BeginContext(4237, 11, false);
#line 102 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                Write(money.Value);

#line default
#line hidden
                EndContext();
                BeginContext(4248, 1, true);
                WriteLiteral(" ");
                EndContext();
                BeginContext(4250, 14, false);
#line 102 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                Write(money.Currency);

#line default
#line hidden
                EndContext();
                BeginContext(4264, 42, true);
                WriteLiteral("</td>\n                                <td>");
                EndContext();
                BeginContext(4307, 58, false);
#line 103 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
                Write(Model.Parkings.SingleOrDefault(p => p.Key == car.Id).Value);

#line default
#line hidden
                EndContext();
                BeginContext(4365, 40, true);
                WriteLiteral("</td>\n                            </tr>\n");
                EndContext();
#line 105 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
            }

#line default
#line hidden
            BeginContext(4431, 1147, true);
            WriteLiteral(@"                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class=""col l6 m12 s12"">
        <div class=""card #ffffff white"">
            <div class=""card-content"">
                <span class=""card-title indigo-text"">News</span>
                <p>
                    <!--  Экспорт новостей TUT.BY  -->
                    <script type=""text/javascript"" src=""https://news.tut.by/export/TUTBYExporter.js"" charset=""utf-8""></script>
                    <script type=""text/javascript"" src=""https://news.tut.by/export/auto/autonews_3.js"" charset=""utf-8""></script>
                    <script type=""text/javascript"">
                        TUTBY.SetTitleStyle(""Verdana, Arial,Helvetica, sans-serif"", 12, ""black"");
                        TUTBY.SetTargetBlank();
                        TUTBY.ExportNews();
                    </script>
                    <!--  Экспорт новостей TUT.BY   -->

                </p>
            </div>
        </div>
    </div>   
        <div id=""O");
            WriteLiteral("rderModal\" class=\"modal\">\n            <div class=\"modal-content\">\n                <h4>Order Status</h4>\n                <p>");
            EndContext();
            BeginContext(5579, 26, false);
#line 133 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
            Write(TempData["SuccessMessage"]);

#line default
#line hidden
            EndContext();
            BeginContext(5605, 275, true);
            WriteLiteral(@"</p>
            </div>
            <div class=""modal-footer"">
                <a href=""#!"" class="" modal-action modal-close waves-effect waves-green btn-flat"" onclick=""ReadyToGo()"">OK</a>
            </div>
        </div>
    </div>
<input type=""hidden"" id=""ok"" data-value='");
            EndContext();
            BeginContext(5881, 14, false);
#line 140 "/Users/maryiapaliashchuk/Downloads/ZEUS/Educo.Parking.Shell.Web/Views/Home/Index.cshtml"
            Write(TempData["OK"]);

#line default
#line hidden
            EndContext();
            BeginContext(5895, 5, true);
            WriteLiteral("\' />\n");
            EndContext();
            DefineSection("scripts", async() => {
                BeginContext(5930, 147, true);
                WriteLiteral("\n        <script src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBLwtv_Ybh-Qqou7wwrMs2PkLufJ2civN0&callback=showMap\" async defer></script>\n\n");
                EndContext();
            }
                          );
        }