Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7002095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:53:07+00:00 2026-05-27T20:53:07+00:00

In AAA pattern where extraction of the act data should be written? In the

  • 0

In “AAA” pattern where extraction of the act data should be written?
In the Act or in the Assert section?

Consider this Unit Test, the extraction of the two persons, should it be in the Act as in the example or in the Assert? we would like to make a standard for all of our UT in the company.

[Test]
public void Test()
{
    // Arrange
    var p1 = new Person();
    var p2 = new Person();
    Session.Save(p1);
    Session.Save(p2);

    // Act
    var result = new PersonQuery().GetAll();
    var firstPerson = result[0];
    var secondPerson = result[1];

    // Assert
    Assert.AreEqual(p1.Id, firstPerson.Id);
    Assert.AreEqual(p2.Id, secondPerson.Id);        
}

(please ignore that in this simple test I can write Assert.AreEqual(p1.Id, result[0].Id);)
I know it’s not a huge problem, but I still want to know how to do things the best.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:53:08+00:00Added an answer on May 27, 2026 at 8:53 pm

    This should happen in the Assert phase:

    [Test]
    public void Test()
    {
        // Arrange
        var p1 = new Person();
        var p2 = new Person();
        Session.Save(p1);
        Session.Save(p2);
    
        // Act
        var result = new PersonQuery().GetAll();
    
        // Assert
        var firstPerson = result[0];
        var secondPerson = result[1];
        Assert.AreEqual(p1.Id, firstPerson.Id);
        Assert.AreEqual(p2.Id, secondPerson.Id);        
    }
    

    The Act phase only involves invoking the method under test.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently this expression I ([a-zA-z]\d]{3} returns when the following pattern is true: I AAA
This is a sample folder structure : mahesh aaa(folder) aa(subfolder) a1(file) xx(file) bbb(folder) bb(subfolder)
I have two maven projects Project AAA AAA-Core AAA-Other Project BBB BBB-Core BBB-AAA-specific I
I'd like to split a string with using pattern like this: it starts and
I have an application that loads aaa.dll. aaa.dll loads two other dlls bbb.dll and
When a IP-Range is written as aaa.bbb.ccc.ddd/netmask ( CIDR Notation ) I need to
in this text : text text text [[st: aaa bbb ccc ddd eee fff]]
I have a CSV file with lines like this: AAA,A-name,num1,num2,num3 BBB,B-name,num1,num2,num3 CCC.DDD,C-name,num1,num2,num3 EEE.FFF.GGGG,E-name,num1,num2,num3 HHH.H-name,num1,num2,num3
Goal: Retrieve data aaa from the first td in tr by pressing the link
This if(is_object($value)) echo 'AAA'; if(gettype($value)==='object') echo 'BBB' Prints 'BBB'. Specifically, value is __PHP_Incomplete_Class Object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.