نظرات مطالب
آزمایش Web APIs توسط Postman - قسمت چهارم - نوشتن آزمون‌ها و اسکریپت‌ها
یک نکته‌ی تکمیلی: نمونه‌هایی از آزمایش‌های Postman


بررسی status code دریافتی از سرور
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Status code is 200", function () {
    pm.expect(pm.response.code).to.equal(200);
});

pm.test("Request is successful", function () {
    pm.response.to.be.succes;
}); // Status code is in the 2XX range

pm.test("Request results in a client error", function () {
    pm.response.to.be.clientError;
}); // Status code is in the 4XX range

pm.test("Request results in a Not Found error", function () {
    pm.response.to.be.notFound;
}); // 404

pm.test("Status code is 200 or 204", function () {
    pm.expect([200, 204]).to.include(pm.response.code);
});

بررسی هدرهای دریافتی از سرور
pm.test("Response has Content-Type header", function () {
    pm.response.to.have.header("Content-Type");
});

pm.test("Response has Content-Type header with application/json; charset = utf - 8 as value", function () {
    pm.response.to.have.header(
        'Content-Type',
        'application/json; charset=utf-8');
});

بررسی بدنه‌ی درخواست
pm.test("Response has a non-empty body", function () {
    pm.expect(pm.response.text()).not.empty;
});

pm.test("Response has a non-empty body", function () {
    pm.expect(pm.response.json()).not.empty;
});

pm.test("Response has a non-empty body", function () {
    pm.response.to.have.body();
});

pm.test("Response has a non-empty body", function () {
    pm.response.to.have.jsonBody();
});

بررسی خواص اشیاء دریافتی از سرور
var updatedAuthor = pm.response.json();
pm.test("Author properties have been updated", function () {
    pm.expect(updatedAuthor.firstName).to.equal("Vahid");
    pm.expect(updatedAuthor.lastName).to.equal("N");
});
مطالب
خلاصه اشتراک‌های روز شنبه 1390/06/26
اشتراک‌ها
سری آموزشی Blazor Server در دات‌نت 8
.NET Blazor Server Beginner to Advance

A complete Blazor Server Web App Development series in which we have developed a complete Job listing site along with admin panel, fully equipped with all the authentication and authorization features where Admin and Manager of the site have different authorities according to their roles.
In this series you will learn all the basic and advance concept of .NET Blazor Web Application Development and project management also as in this series we are tracking the progress of the project using the JetBrain’s YouTrack Project management tool and agile board.



سری آموزشی Blazor Server در دات‌نت 8
نظرات مطالب
Blazor 5x - قسمت 34 - توزیع برنامه‌های Blazor بر روی IIS
روش درست کردن دمو برای پروژه‌های blazor در Github (یا روش توزیع پروژه‌های Blazor WASM در Github-Pages)

ابتدا فایل yml زیر را در پوشه‌ی github\workflows\deploy.yml. قرار دهید (پوشه‌ای را به این نام، در ریشه‌ی پروژه‌ی خود ایجاد کنید):
name: Deploy to GitHub Pages

# Run workflow on every push to the main branch
on:
  push:
    branches: [ main ]

jobs:
  deploy-to-github-pages:
    # use ubuntu-latest image to run steps on
    runs-on: ubuntu-latest
    steps:
    # uses GitHub's checkout action to checkout code form the main branch
    - uses: actions/checkout@v2
    
    # sets up .NET Core SDK
    - name: Setup .NET Core SDK
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 5.0.302

    # publishes Blazor project to the release-folder
    - name: Publish .NET Core Project
      run: dotnet publish ./src/DNTPersianComponents.Blazor.WasmSample/Server/DNTPersianComponents.Blazor.WasmSample.Server.csproj -c Release -o release --nologo
    
    # changes the base-tag in index.html from '/' to 'DNTPersianComponents.Blazor' to match GitHub Pages repository subdirectory
    - name: Change base-tag in index.html from / to DNTPersianComponents.Blazor
      run: sed -i 's/<base href="\/" \/>/<base href="\/DNTPersianComponents.Blazor\/" \/>/g' release/wwwroot/index.html
    
    # copy index.html to 404.html to serve the same file when a file is not found
    - name: copy index.html to 404.html
      run: cp release/wwwroot/index.html release/wwwroot/404.html

    # add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)
    - name: Add .nojekyll file
      run: touch release/wwwroot/.nojekyll
      
    - name: Commit wwwroot to GitHub Pages
      uses: JamesIves/github-pages-deploy-action@3.7.1
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        BRANCH: github-pages
        FOLDER: release/wwwroot
در این قالب، چهار مورد را باید ویرایش کنید:
- نام شاخه‌ی اصلی پروژه؛ که یا main است و یا master.
- شماره نگارش دات نت مورد استفاده.
- مسیر فایل csproj پروژه‌ی wasm.
- نام اصلی مخزن کد.


سپس آن‌را به مخزن کد خود commit کنید. بعد به قسمت settings->pages در github مراجعه کرده و source را بر روی نام شاخه‌ی جدید github-pages (فوق در قسمت آخر کار) قرار داده و آن‌را ذخیره کنید. الان سایت دموی شما در مسیری که در همین قسمت pages پس از ذخیره سازی، نمایش می‌دهد، آماده‌است.


یک نکته‌ی مهم

چون base href، توسط action فوق اصلاح می‌شود تا به پوشه‌ی نسبی محل قرارگیری برنامه اشاره کند، نیاز است navlink‌ها با href شروع شده‌ی با / نباشند؛ چون به ریشه‌ی سایت اشاره می‌کنند و نه مسیر نسبی محل قرارگیری برنامه. کلا در هر قسمتی از برنامه، این نکته باید رعایت شود. مثلا اگر فونت وبی را در فایل app.css تعریف کرده‌اید، مسیر آن نباید با / شروع شود؛ وگرنه یافت نخواهد شد. یک مثال:
فایل app.css برنامه در مسیر wwwroot\css\app.css قرار دارد و داخل آن فایل، فونت‌های پوشه‌ی دیگر wwwroot\lib\samim-font را به صورت زیر تعریف کرده‌ایم؛ که یعنی مسیر فونت را از ریشه‌ی سایت پیدا کن:
src: url('/lib/samim-font/Samim-Bold.eot?v=4.0.5');
این مسیر، باید به مسیر نسبی زیر که به یک پوشه‌ی بالاتر (از محل قرار گیری app.css) اشاره می‌کند، اصلاح شود:
src: url('../lib/samim-font/Samim-Bold.eot?v=4.0.5');
اشتراک‌ها
Bootstrap Icons v1.0.0 منتشر شد

After five alphas over the last nine months, Bootstrap Icons has officially gone stable with our v1.0.0 release! We’re now over 1,100 icons and are on track to add hundreds more in our upcoming minor releases. This has been a labor of love and I’m thrilled to ship this latest update. 

Bootstrap Icons v1.0.0 منتشر شد
اشتراک‌ها
پیاده سازی In Memory OLTP در SQL Server

How do you go about transferring a disk-based workload to the respective memory-optimized design? How do you process memory-optimized tables? How important for performance are natively-compiled Stored Procedures? Artemakis Artemiou comes up with a step-by-step guide to implementing an in-memory OLTP solution .  

پیاده سازی In Memory OLTP در SQL Server
اشتراک‌ها
استفاده رایگان از Xamarin در تمامی نسخه‌های Visual Studio

 In short, we’re making Xamarin’s cross-platform tools available in Visual Studio, from Community up through Enterprise at no additional cost and we’re open-sourcing the Xamarin SDK – the core of the Xamarin toolchain. In addition, we’re making Xamarin’s services (for example, Test Cloud and Xamarin University) available along with the existing Microsoft mobile DevOps capabilities.

https://blog.xamarin.com/xamarin-for-all/?utm_medium=social&utm_campaign=blog&utm_source=twitter&utm_content=xamarin-for-all 


استفاده رایگان از Xamarin در تمامی نسخه‌های Visual Studio