Theorem environment and Fancybox

A simple solution with theframed option from ntheorem and the eponymous package:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{amsmath,fancybox}

\usepackage{framed}

 \usepackage[thmmarks, thref, amsmath, framed]{ntheorem}

  \def\theoremframecommand{\doublebox}
  \theoremheaderfont{\bfseries}
  \theorembodyfont{\normalfont}
  \theoremseparator{.}
  \newshadedtheorem{thmtest}{Test}

\begin{document}

\begin{thmtest}
Bla bla bla
\end{thmtest}

\end{document} 

enter image description here


You can use tcolorbox, which allows for much power over customizations than fancybox.

\documentclass{article}

\usepackage{amsmath,amsthm}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}

\newtheorem{test}{Test}
\tcolorboxenvironment{test}{
  enhanced,
  borderline={0.8pt}{0pt}{black},
  borderline={0.4pt}{2pt}{black},
  boxrule=0.4pt,
  colback=white,
  coltitle=black,
  sharp corners,
}

\begin{document}

\lipsum[2]

\begin{test}
bla bla bla
\end{test}

\lipsum[2]

\end{document}

enter image description here


\documentclass{article}

\usepackage{amsmath,fancybox}
\usepackage{calc}
\newtheorem{test}{Test}

\newenvironment{boxedtest}
{\noindent\begin{Sbox}\begin{minipage}{\linewidth-7.5\fboxrule-2\fboxsep-1pt}\begin{test}}
{\end{test}\end{minipage}\end{Sbox}\doublebox{\TheSbox}}

\begin{document}

\begin{boxedtest}
  bla bla bla
\end{boxedtest}

\end{document}

enter image description here